(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 12.1' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       158,          7]
NotebookDataLength[    298001,       7649]
NotebookOptionsPosition[    276099,       7295]
NotebookOutlinePosition[    276567,       7313]
CellTagsIndexPosition[    276524,       7310]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell["\<\
\[OpenCurlyDoubleQuote]Exploiting rivals\[CloseCurlyQuote] strength\
\[CloseCurlyDoubleQuote]: appendix on Adverse Selection model\
\>", "Title",
 CellChangeTimes->{{3.8036104113372903`*^9, 3.803610413859366*^9}, 
   3.8036104561932397`*^9, {3.82133430830974*^9, 3.8213343243902283`*^9}, {
   3.924573390132861*^9, 
   3.9245734098728685`*^9}},ExpressionUUID->"2d7cdfda-3529-4250-9524-\
675b0650cc94"],

Cell["Giacomo Calzolari and Vincenzo Denicol\[OGrave]", "Text",
 CellChangeTimes->{{3.803610483903702*^9, 3.8036105121470833`*^9}, {
  3.8213343288340473`*^9, 3.8213343486681633`*^9}, {3.8264551002056427`*^9, 
  3.8264551014558153`*^9}, {3.8297139944538994`*^9, 3.8297139958342457`*^9}, {
  3.8707431416427207`*^9, 3.8707431448820543`*^9}, {3.924573369027151*^9, 
  3.9245733731688075`*^9}, {3.9270852276666546`*^9, 
  3.9270852320150824`*^9}},ExpressionUUID->"7f4410a6-6137-4b21-adf7-\
8aeb55c4a1e0"],

Cell[CellGroupData[{

Cell["Preferences and setup", "Section",
 CellChangeTimes->{{3.923564447292219*^9, 
  3.923564454151762*^9}},ExpressionUUID->"4edc7394-9758-4adf-a6d7-\
108085b20569"],

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"Buyer", "'"}], "s", " ", "payoff"}], "*)"}], 
  "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{"u", " ", "=", 
    RowBox[{
     RowBox[{
      RowBox[{"(", 
       RowBox[{"1", "+", "\[Theta]"}], ")"}], 
      RowBox[{"(", " ", 
       RowBox[{"q1", " ", "+", " ", "q2"}], ")"}]}], " ", "-", " ", 
     RowBox[{
      RowBox[{"1", "/", "2"}], " ", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"q1", "^", "2"}], "+", 
        RowBox[{"q2", "^", "2"}]}], ")"}]}], " ", "-", "  ", 
     RowBox[{"\[Gamma]", "  ", "q1", "  ", "q2"}]}]}], ";"}]}]], "Input",
 CellChangeTimes->{{3.8679305684295764`*^9, 3.867930573005742*^9}, {
   3.885100298696314*^9, 3.8851003087713766`*^9}, {3.885356530909478*^9, 
   3.8853565340153975`*^9}, 3.8853565735191593`*^9, {3.8856210896076956`*^9, 
   3.88562109441042*^9}, {3.923564483272584*^9, 3.9235644893069563`*^9}, {
   3.9263924559552994`*^9, 3.9263924584572883`*^9}},
 CellLabel->"In[1]:=",ExpressionUUID->"a3d8119a-5ceb-4c29-806f-36c8c9577bc0"],

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"Types", " ", "\[Theta]", " ", "uniform", " ", 
     RowBox[{"over", " ", "[", 
      RowBox[{
       RowBox[{"-", "d"}], ",", " ", 
       RowBox[{"+", "d"}]}], "]"}]}], ":"}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"F", "=", 
     RowBox[{
      RowBox[{"(", 
       RowBox[{"\[Theta]", "+", "d"}], ")"}], "/", 
      RowBox[{"(", 
       RowBox[{"2", " ", "d"}], ")"}]}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"f", "=", 
     RowBox[{"D", "[", 
      RowBox[{"F", ",", "\[Theta]"}], "]"}]}], ";"}]}]}]], "Input",
 CellChangeTimes->{{3.88510033399092*^9, 3.885100394409831*^9}, {
  3.9235644779588685`*^9, 3.923564501997813*^9}, {3.923564537366522*^9, 
  3.9235645378229427`*^9}, {3.9263924425545635`*^9, 3.9263924523112187`*^9}, {
  3.9270852397574377`*^9, 3.9270852433229003`*^9}},
 CellLabel->"In[2]:=",ExpressionUUID->"7e2d0319-45f4-4a73-819a-b523bb0eb15a"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"Useful", " ", "material", " ", "for", " ", 
    RowBox[{"implementation", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"u", "-", " ", 
     RowBox[{"a1", " ", "q1"}], "-", 
     RowBox[{"a2", " ", 
      RowBox[{"q1", "^", "2"}]}], "-", 
     RowBox[{"b1", " ", "q2"}], "-", 
     RowBox[{"b2", " ", 
      RowBox[{"q2", "^", "2"}]}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{"Solve", "[", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{
          RowBox[{"D", "[", 
           RowBox[{"%", ",", "q1"}], "]"}], "\[Equal]", "0"}], ",", 
         RowBox[{
          RowBox[{"D", "[", 
           RowBox[{"%", ",", "q2"}], "]"}], "\[Equal]", "0"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"q1", ",", "q2"}], "}"}]}], "]"}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"q1ind", "=", 
    RowBox[{"%", "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}], 
   "\[IndentingNewLine]", 
   RowBox[{"q2ind", "=", 
    RowBox[{"%%", "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "2", ",", "2"}], "]"}], "]"}]}], 
   "\[IndentingNewLine]", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"u", "-", 
      RowBox[{"a1", " ", "q1"}], "-", 
      RowBox[{"a2", " ", 
       RowBox[{"q1", "^", "2"}]}]}], "/.", 
     RowBox[{"q2", "\[Rule]", "0"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"q1Eind", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{
         RowBox[{"D", "[", 
          RowBox[{"%", ",", "q1"}], "]"}], "\[Equal]", "0"}], ",", "q1"}], 
       "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.923565287735504*^9, 3.9235652992536726`*^9}, {
  3.9235654381265736`*^9, 3.9235654548229723`*^9}, {3.923627389750417*^9, 
  3.9236273905158587`*^9}},
 CellLabel->"In[4]:=",ExpressionUUID->"4149c52e-1778-4b47-b488-06b89af439cf"],

Cell[BoxData[
 FractionBox[
  RowBox[{"1", "-", 
   RowBox[{"a1", " ", 
    RowBox[{"(", 
     RowBox[{"1", "+", 
      RowBox[{"2", " ", "b2"}]}], ")"}]}], "+", 
   RowBox[{"\[Gamma]", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "b1", "-", "\[Theta]"}], ")"}]}], "+", 
   "\[Theta]", "+", 
   RowBox[{"2", " ", "b2", " ", 
    RowBox[{"(", 
     RowBox[{"1", "+", "\[Theta]"}], ")"}]}]}], 
  RowBox[{"1", "+", 
   RowBox[{"2", " ", "b2"}], "+", 
   RowBox[{"a2", " ", 
    RowBox[{"(", 
     RowBox[{"2", "+", 
      RowBox[{"4", " ", "b2"}]}], ")"}]}], "-", 
   SuperscriptBox["\[Gamma]", "2"]}]]], "Output",
 CellChangeTimes->{
  3.923565300410282*^9, 3.9235654554667606`*^9, 3.9236236497404003`*^9, 
   3.9236238122827888`*^9, 3.92458302948085*^9, {3.9263924745162416`*^9, 
   3.926392476025694*^9}, 3.926997897159154*^9, 3.9270838734207706`*^9, 
   3.9270855887725563`*^9},
 CellLabel->"Out[6]=",ExpressionUUID->"c3151613-186f-4d26-98d7-5eb55395f524"],

Cell[BoxData[
 FractionBox[
  RowBox[{"1", "-", "b1", "+", 
   RowBox[{"\[Gamma]", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "a1", "-", "\[Theta]"}], ")"}]}], "+", 
   "\[Theta]", "+", 
   RowBox[{"2", " ", "a2", " ", 
    RowBox[{"(", 
     RowBox[{"1", "-", "b1", "+", "\[Theta]"}], ")"}]}]}], 
  RowBox[{"1", "+", 
   RowBox[{"2", " ", "b2"}], "+", 
   RowBox[{"a2", " ", 
    RowBox[{"(", 
     RowBox[{"2", "+", 
      RowBox[{"4", " ", "b2"}]}], ")"}]}], "-", 
   SuperscriptBox["\[Gamma]", "2"]}]]], "Output",
 CellChangeTimes->{
  3.923565300410282*^9, 3.9235654554667606`*^9, 3.9236236497404003`*^9, 
   3.9236238122827888`*^9, 3.92458302948085*^9, {3.9263924745162416`*^9, 
   3.926392476025694*^9}, 3.926997897159154*^9, 3.9270838734207706`*^9, 
   3.927085588775544*^9},
 CellLabel->"Out[7]=",ExpressionUUID->"903d3857-551e-4083-9600-4e50fad45d50"],

Cell[BoxData[
 FractionBox[
  RowBox[{"1", "-", "a1", "+", "\[Theta]"}], 
  RowBox[{"1", "+", 
   RowBox[{"2", " ", "a2"}]}]]], "Output",
 CellChangeTimes->{
  3.923565300410282*^9, 3.9235654554667606`*^9, 3.9236236497404003`*^9, 
   3.9236238122827888`*^9, 3.92458302948085*^9, {3.9263924745162416`*^9, 
   3.926392476025694*^9}, 3.926997897159154*^9, 3.9270838734207706`*^9, 
   3.927085588825379*^9},
 CellLabel->"Out[9]=",ExpressionUUID->"45a9edc3-1dbe-40ea-acea-751540766d5d"]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["1 Ramsey Boiteaux", "Section",
 CellChangeTimes->{{3.886574819363182*^9, 3.886574824203349*^9}, {
  3.923623520674799*^9, 
  3.9236235210047445`*^9}},ExpressionUUID->"007d19a6-a447-4413-880a-\
156453aa69ef"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"Reservation", " ", "payoff", " ", "of", " ", "the", " ", 
    RowBox[{"buyer", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{"u", "-", 
      RowBox[{"c", " ", "q2"}]}], "/.", 
     RowBox[{"q1", "\[Rule]", "0"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"qe2", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{
         RowBox[{"D", "[", 
          RowBox[{"%", ",", "q2"}], "]"}], "\[Equal]", "0"}], ",", "q2"}], 
       "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}], 
   "\[IndentingNewLine]", 
   RowBox[{"VR", "=", 
    RowBox[{"FullSimplify", "[", 
     RowBox[{"%%", "/.", 
      RowBox[{"q2", "\[Rule]", "qe2"}]}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.885356645987503*^9, 3.8853566870967016`*^9}, {
  3.885357001001544*^9, 3.8853570023104887`*^9}, {3.8855262680108223`*^9, 
  3.885526287320571*^9}, {3.92356455994858*^9, 3.9235645724023914`*^9}, {
  3.9269982160833917`*^9, 3.9269982165928173`*^9}, {3.9270868350189896`*^9, 
  3.9270868351526012`*^9}},
 CellLabel->
  "In[323]:=",ExpressionUUID->"99b2f438-3892-44b5-97b1-572a5ca798da"],

Cell[BoxData[
 RowBox[{"1", "-", "c", "+", "\[Theta]"}]], "Output",
 CellChangeTimes->{{3.8853566701511006`*^9, 3.885356687635709*^9}, 
   3.885357003677146*^9, 3.885376249222525*^9, {3.885526260423992*^9, 
   3.8855262884146404`*^9}, 3.8856188424477777`*^9, 3.8856210184354806`*^9, 
   3.8856210993258*^9, 3.885885512809072*^9, 3.886565081583385*^9, 
   3.886656785596897*^9, 3.8877709711429396`*^9, 3.8879418613648343`*^9, 
   3.888145097526719*^9, 3.88830373589299*^9, 3.89166122100865*^9, 
   3.9224990632627892`*^9, 3.923564574751687*^9, 3.9236236733899326`*^9, 
   3.923623815396402*^9, 3.9245830294964533`*^9, 3.9263924841026454`*^9, 
   3.926393137347875*^9, 3.9269978984978266`*^9, 3.926998217648963*^9, 
   3.927083879596338*^9, 3.9270855888393326`*^9, 3.927086835909968*^9},
 CellLabel->
  "Out[324]=",ExpressionUUID->"c023fdce-7a4f-48ce-b702-e6f239922ead"],

Cell[BoxData[
 RowBox[{
  FractionBox["1", "2"], " ", 
  SuperscriptBox[
   RowBox[{"(", 
    RowBox[{"1", "-", "c", "+", "\[Theta]"}], ")"}], "2"]}]], "Output",
 CellChangeTimes->{{3.8853566701511006`*^9, 3.885356687635709*^9}, 
   3.885357003677146*^9, 3.885376249222525*^9, {3.885526260423992*^9, 
   3.8855262884146404`*^9}, 3.8856188424477777`*^9, 3.8856210184354806`*^9, 
   3.8856210993258*^9, 3.885885512809072*^9, 3.886565081583385*^9, 
   3.886656785596897*^9, 3.8877709711429396`*^9, 3.8879418613648343`*^9, 
   3.888145097526719*^9, 3.88830373589299*^9, 3.89166122100865*^9, 
   3.9224990632627892`*^9, 3.923564574751687*^9, 3.9236236733899326`*^9, 
   3.923623815396402*^9, 3.9245830294964533`*^9, 3.9263924841026454`*^9, 
   3.926393137347875*^9, 3.9269978984978266`*^9, 3.926998217648963*^9, 
   3.927083879596338*^9, 3.9270855888393326`*^9, 3.927086835951828*^9},
 CellLabel->
  "Out[325]=",ExpressionUUID->"26406f6f-5294-4cba-ab13-556203088725"]
}, Open  ]],

Cell[BoxData[
 RowBox[{"(*", 
  RowBox[{
   RowBox[{
    RowBox[{
    "The", " ", "participation", " ", "constraint", " ", "may", " ", "bind", 
     " ", "for", " ", "several", " ", 
     RowBox[{"(", "low", ")"}], " ", 
     RowBox[{"types", ".", " ", "We"}], " ", "show", " ", "that", " ", 
     "there", " ", "can", " ", "be", " ", "three", " ", 
     RowBox[{"cases", ":", " ", 
      RowBox[{
      "binding", " ", "only", " ", "for", " ", "the", " ", "lowest", " ", 
       "types"}]}]}], ",", " ", 
    RowBox[{
    "binding", " ", "for", " ", "a", " ", "group", " ", "of", " ", "low", " ",
      "types"}], ",", " ", 
    RowBox[{"binding", " ", "for", " ", "all", " ", 
     RowBox[{"types", ".", " ", "To"}], " ", "see", " ", "this", " ", "we", 
     " ", "need", " ", "to", " ", "see", " ", "how", " ", "the", " ", 
     "equilirium", " ", "buyer", " ", "payoffs", " ", "varies", " ", "for", 
     " ", "the", " ", "types"}], ",", " ", 
    RowBox[{"comparing", " ", "with", " ", "the", " ", "reservation", " ", 
     RowBox[{"utility", "."}]}]}], ")"}]}]], "Input",
 CellChangeTimes->{{3.9236239634736*^9, 3.923623986653084*^9}},
 CellLabel->"In[13]:=",ExpressionUUID->"ecbb6c4d-6769-4b1c-8a7c-5b5e52f7c103"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
   "Assuming", " ", "the", " ", "participation", " ", "binds", " ", "for", 
    " ", "the", " ", "lowest", " ", "type", " ", 
    RowBox[{"only", ":", " ", 
     RowBox[{
     "optimization", " ", "with", " ", "direct", " ", "revelation", " ", 
      "mechanism"}], ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"u", "-", 
     RowBox[{"c", " ", "q2"}], " ", "-", 
     RowBox[{
      RowBox[{
       RowBox[{"(", 
        RowBox[{"1", "-", "F"}], ")"}], "/", "f"}], "  ", 
      RowBox[{"D", "[", 
       RowBox[{"u", ",", "\[Theta]"}], "]"}]}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{"Solve", "[", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{
          RowBox[{"D", "[", 
           RowBox[{"%", ",", "q1"}], "]"}], "\[Equal]", "0"}], ",", 
         RowBox[{
          RowBox[{"D", "[", 
           RowBox[{"%", ",", "q2"}], "]"}], "\[Equal]", "0"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"q1", ",", "q2"}], "}"}]}], "]"}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"U", "'"}], "[", "\[Theta]", "]"}], "==", 
      RowBox[{"D", "[", 
       RowBox[{"u", ",", "\[Theta]"}], "]"}]}], "/.", 
     RowBox[{"%", "[", 
      RowBox[{"[", "1", "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"DSolve", "[", 
     RowBox[{"%", ",", 
      RowBox[{"U", "[", "\[Theta]", "]"}], ",", "\[Theta]"}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"Usol", "=", 
    RowBox[{"%", "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}], 
   "\[IndentingNewLine]", 
   RowBox[{"q1sol", "=", 
    RowBox[{"%%%%", "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}], 
   "\[IndentingNewLine]", 
   RowBox[{"q2sol", "=", 
    RowBox[{"%%%%%", "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "2", ",", "2"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.8853567434478607`*^9, 3.885356810321269*^9}, {
   3.885356849840927*^9, 3.88535697862727*^9}, 3.885376266564506*^9, {
   3.8856215142157307`*^9, 3.885621554957187*^9}, {3.923564626156087*^9, 
   3.9235646719467516`*^9}, 3.9236237063055415`*^9, {3.9236239888927484`*^9, 
   3.923624000772832*^9}},
 CellLabel->"In[13]:=",ExpressionUUID->"6858c079-6ab1-4cd9-a8b9-89b26d56d6f4"],

Cell[BoxData[
 RowBox[{
  FractionBox[
   RowBox[{
    RowBox[{"2", " ", "\[Theta]"}], "-", 
    RowBox[{"c", " ", "\[Theta]"}], "-", 
    RowBox[{"2", " ", "d", " ", "\[Theta]"}], "+", 
    RowBox[{"2", " ", 
     SuperscriptBox["\[Theta]", "2"]}]}], 
   RowBox[{"1", "+", "\[Gamma]"}]], "+", 
  TemplateBox[{"1"},
   "C"]}]], "Output",
 CellChangeTimes->{
  3.8853568010963783`*^9, 3.8853569465532055`*^9, 3.8853569792341394`*^9, {
   3.885376257489008*^9, 3.885376267698619*^9}, 3.885526300255088*^9, 
   3.885620868512521*^9, 3.8856211086046896`*^9, {3.8856215366211576`*^9, 
   3.8856215567944756`*^9}, 3.885885526065938*^9, 3.8865650955145617`*^9, 
   3.8866567861076193`*^9, 3.8877709716128736`*^9, 3.8879418616656513`*^9, 
   3.888145097761425*^9, 3.8883037361422796`*^9, 3.891661221183025*^9, 
   3.9224990633409214`*^9, {3.9235646670393963`*^9, 3.9235646724441695`*^9}, 
   3.923623708012483*^9, 3.92362382279432*^9, 3.9245830296810703`*^9, 
   3.926392517851263*^9, 3.92639314798755*^9, 3.926393830202466*^9, 
   3.926997898823152*^9, 3.9270838799785023`*^9, 3.927085589218484*^9},
 CellLabel->"Out[17]=",ExpressionUUID->"e54d8e33-1364-4ab5-992c-e86a1cb8dfb0"],

Cell[BoxData[
 FractionBox[
  RowBox[{
   RowBox[{"-", "1"}], "+", "d", "+", "\[Gamma]", "-", 
   RowBox[{"c", " ", "\[Gamma]"}], "-", 
   RowBox[{"d", " ", "\[Gamma]"}], "+", 
   RowBox[{"2", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], " ", "\[Theta]"}]}], 
  RowBox[{
   RowBox[{"-", "1"}], "+", 
   SuperscriptBox["\[Gamma]", "2"]}]]], "Output",
 CellChangeTimes->{
  3.8853568010963783`*^9, 3.8853569465532055`*^9, 3.8853569792341394`*^9, {
   3.885376257489008*^9, 3.885376267698619*^9}, 3.885526300255088*^9, 
   3.885620868512521*^9, 3.8856211086046896`*^9, {3.8856215366211576`*^9, 
   3.8856215567944756`*^9}, 3.885885526065938*^9, 3.8865650955145617`*^9, 
   3.8866567861076193`*^9, 3.8877709716128736`*^9, 3.8879418616656513`*^9, 
   3.888145097761425*^9, 3.8883037361422796`*^9, 3.891661221183025*^9, 
   3.9224990633409214`*^9, {3.9235646670393963`*^9, 3.9235646724441695`*^9}, 
   3.923623708012483*^9, 3.92362382279432*^9, 3.9245830296810703`*^9, 
   3.926392517851263*^9, 3.92639314798755*^9, 3.926393830202466*^9, 
   3.926997898823152*^9, 3.9270838799785023`*^9, 3.9270855892224693`*^9},
 CellLabel->"Out[18]=",ExpressionUUID->"53d07c93-a2a5-47e1-a29e-f0fb8a880b29"],

Cell[BoxData[
 FractionBox[
  RowBox[{"c", "-", 
   RowBox[{
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "d", "-", 
      RowBox[{"2", " ", "\[Theta]"}]}], ")"}]}]}], 
  RowBox[{
   RowBox[{"-", "1"}], "+", 
   SuperscriptBox["\[Gamma]", "2"]}]]], "Output",
 CellChangeTimes->{
  3.8853568010963783`*^9, 3.8853569465532055`*^9, 3.8853569792341394`*^9, {
   3.885376257489008*^9, 3.885376267698619*^9}, 3.885526300255088*^9, 
   3.885620868512521*^9, 3.8856211086046896`*^9, {3.8856215366211576`*^9, 
   3.8856215567944756`*^9}, 3.885885526065938*^9, 3.8865650955145617`*^9, 
   3.8866567861076193`*^9, 3.8877709716128736`*^9, 3.8879418616656513`*^9, 
   3.888145097761425*^9, 3.8883037361422796`*^9, 3.891661221183025*^9, 
   3.9224990633409214`*^9, {3.9235646670393963`*^9, 3.9235646724441695`*^9}, 
   3.923623708012483*^9, 3.92362382279432*^9, 3.9245830296810703`*^9, 
   3.926392517851263*^9, 3.92639314798755*^9, 3.926393830202466*^9, 
   3.926997898823152*^9, 3.9270838799785023`*^9, 3.927085589225459*^9},
 CellLabel->"Out[19]=",ExpressionUUID->"9719bd79-e8f3-4d20-a606-b1a7647eedd1"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"Optimal", " ", "fixed", " ", "fee"}], ",", " ", 
    RowBox[{
    "making", " ", "the", " ", "lowest", " ", "type", " ", "indifferent", " ",
      "with", " ", "the", " ", "reservation", " ", "payoff"}]}], "*)"}], 
  "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"Usol", "/.", 
     RowBox[{"\[Theta]", "\[Rule]", 
      RowBox[{"-", "d"}]}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"VR", "/.", 
     RowBox[{"\[Theta]", "\[Rule]", 
      RowBox[{"-", "d"}]}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"fixedfee", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{"%", "==", "%%"}], ",", 
        TemplateBox[{"1"},
         "C"]}], "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.885356893412489*^9, 3.8853568964891367`*^9}, {
  3.8853569856559196`*^9, 3.8853570392479553`*^9}, {3.8858858794071455`*^9, 
  3.8858858886638794`*^9}, {3.9235646839362583`*^9, 3.9235646904719443`*^9}, {
  3.923567507333855*^9, 3.9235675186155725`*^9}, {3.9263931566450152`*^9, 
  3.9263931636432257`*^9}},
 CellLabel->
  "In[326]:=",ExpressionUUID->"2e9fe6cf-7079-4ce9-ba7c-bb0b0fe0264c"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   FractionBox["1", "2"], " ", 
   SuperscriptBox[
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "c", "+", "d"}], ")"}], "2"]}], "-", 
  FractionBox[
   RowBox[{"d", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "2"}], "+", "c", "+", 
      RowBox[{"4", " ", "d"}]}], ")"}]}], 
   RowBox[{"1", "+", "\[Gamma]"}]]}]], "Output",
 CellChangeTimes->{
  3.8853570408330765`*^9, 3.8853762907091784`*^9, 3.8856214837964845`*^9, 
   3.885885532246649*^9, 3.885885889233856*^9, 3.8865651028131638`*^9, 
   3.8866567864034705`*^9, 3.8877709753312893`*^9, 3.8879418619664865`*^9, 
   3.888145098018935*^9, 3.8883037364256997`*^9, 3.891661221369564*^9, 
   3.9224990634946136`*^9, 3.9235646911628428`*^9, 3.9235675225106897`*^9, 
   3.923623750940116*^9, 3.9236238325629387`*^9, 3.9245830298865457`*^9, 
   3.9263925223079977`*^9, {3.926393161100509*^9, 3.9263931644262457`*^9}, 
   3.9269978991571035`*^9, 3.9269982240755124`*^9, 3.927083880270547*^9, 
   3.927085589547103*^9, 3.9270868438742867`*^9},
 CellLabel->
  "Out[328]=",ExpressionUUID->"fd5762dc-9756-4823-9982-c95ca64d15fb"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
   "The", " ", "quantity", " ", "of", " ", "good", " ", "2", " ", "may", " ", 
    "become", " ", "nil", " ", "due", " ", "to", " ", "the", " ", 
    RowBox[{"cost", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"q2sol", "/.", 
     RowBox[{"\[Theta]", "\[Rule]", 
      RowBox[{"-", "d"}]}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"FullSimplify", "[", 
    RowBox[{"Reduce", "[", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"%", ">", "0"}], ",", 
       RowBox[{"1", ">", "c", ">", "0"}], ",", 
       RowBox[{"1", ">", "\[Gamma]", ">", "0"}], ",", 
       RowBox[{"1", ">", "d", ">", "0"}]}], "}"}], "]"}], "]"}], 
   "\[IndentingNewLine]", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"q2sol", "/.", 
     RowBox[{"\[Theta]", "\[Rule]", 
      RowBox[{"-", "d"}]}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"Dq2sol", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{"%", "\[Equal]", "0"}], ",", "d"}], "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}], 
   "\[IndentingNewLine]", "\[IndentingNewLine]", 
   RowBox[{"Dq2sol", ";"}], "\[IndentingNewLine]", 
   RowBox[{"Manipulate", "[", 
    RowBox[{
     RowBox[{"Plot", "[", 
      RowBox[{"%", ",", 
       RowBox[{"{", 
        RowBox[{"\[Gamma]", ",", "0", ",", "1"}], "}"}], ",", 
       RowBox[{"PlotRange", "\[Rule]", 
        RowBox[{"{", 
         RowBox[{"0", ",", "1"}], "}"}]}]}], "]"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"c", ",", "0.1"}], "}"}], ",", "0", ",", "1"}], "}"}]}], 
    "]"}]}]}]], "Input",
 CellChangeTimes->{{3.885621695004546*^9, 3.8856217410436687`*^9}, {
  3.923567548871807*^9, 3.92356757516986*^9}, {3.923623746535205*^9, 
  3.9236237478797283`*^9}, {3.9263931693892603`*^9, 3.926393171944672*^9}},
 CellLabel->
  "In[329]:=",ExpressionUUID->"3af8abef-eaef-4e3d-b6a2-cff1ff272967"],

Cell[BoxData[
 RowBox[{
  RowBox[{"\[Gamma]", ">", "0"}], "&&", 
  RowBox[{"c", ">", "0"}], "&&", 
  RowBox[{"d", ">", "0"}], "&&", 
  RowBox[{
   RowBox[{"c", "+", "\[Gamma]"}], "<", "1"}], "&&", 
  RowBox[{
   RowBox[{"c", "+", "\[Gamma]"}], "<", 
   RowBox[{"1", "+", 
    RowBox[{"3", " ", "d", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}]}]}]}]}]], "Output",
 CellChangeTimes->{
  3.8856217428819695`*^9, 3.8858855419140024`*^9, 3.886656787069237*^9, 
   3.887770977042303*^9, 3.887941862784433*^9, 3.8881450981256533`*^9, 
   3.8883037365364037`*^9, 3.8916612214852233`*^9, 3.922499063666712*^9, 
   3.9235675771284513`*^9, 3.923623760342407*^9, {3.9236238787796493`*^9, 
   3.9236238896389337`*^9}, 3.924583030289374*^9, 3.9263931740051208`*^9, 
   3.926393687819787*^9, 3.9269978998617516`*^9, 3.9270838811052837`*^9, 
   3.927085590667444*^9, 3.9270868471831846`*^9},
 CellLabel->
  "Out[330]=",ExpressionUUID->"3c07e1ff-5d2c-424a-90b8-062f6f3b806f"],

Cell[BoxData[
 FractionBox[
  RowBox[{
   RowBox[{"-", "1"}], "+", "c", "+", "\[Gamma]"}], 
  RowBox[{"3", " ", 
   RowBox[{"(", 
    RowBox[{
     RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}]}]]], "Output",
 CellChangeTimes->{
  3.8856217428819695`*^9, 3.8858855419140024`*^9, 3.886656787069237*^9, 
   3.887770977042303*^9, 3.887941862784433*^9, 3.8881450981256533`*^9, 
   3.8883037365364037`*^9, 3.8916612214852233`*^9, 3.922499063666712*^9, 
   3.9235675771284513`*^9, 3.923623760342407*^9, {3.9236238787796493`*^9, 
   3.9236238896389337`*^9}, 3.924583030289374*^9, 3.9263931740051208`*^9, 
   3.926393687819787*^9, 3.9269978998617516`*^9, 3.9270838811052837`*^9, 
   3.927085590667444*^9, 3.9270868471881685`*^9},
 CellLabel->
  "Out[332]=",ExpressionUUID->"f4203f07-fb35-44ea-b01b-268a945032de"],

Cell[BoxData[
 TagBox[
  StyleBox[
   DynamicModuleBox[{$CellContext`c$$ = 0.1, Typeset`show$$ = True, 
    Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", 
    Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = 
    "\"untitled\"", Typeset`specs$$ = {{{
       Hold[$CellContext`c$$], 0.1}, 0, 1}}, Typeset`size$$ = {
    360., {116., 120.24657259881528`}}, Typeset`update$$ = 0, 
    Typeset`initDone$$, Typeset`skipInitDone$$ = True}, 
    DynamicBox[Manipulate`ManipulateBoxes[
     1, StandardForm, "Variables" :> {$CellContext`c$$ = 0.1}, 
      "ControllerVariables" :> {}, 
      "OtherVariables" :> {
       Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, 
        Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, 
        Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$,
         Typeset`skipInitDone$$}, "Body" :> 
      Plot[Rational[
         1, 3] (-1 + $CellContext`\[Gamma])^(-1) (-1 + $CellContext`c$$ + \
$CellContext`\[Gamma]), {$CellContext`\[Gamma], 0, 1}, PlotRange -> {0, 1}], 
      "Specifications" :> {{{$CellContext`c$$, 0.1}, 0, 1}}, "Options" :> {}, 
      "DefaultOptions" :> {}],
     ImageSizeCache->{817., {145., 151.}},
     SingleEvaluation->True],
    Deinitialization:>None,
    DynamicModuleValues:>{},
    SynchronousInitialization->True,
    UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$},
    UnsavedVariables:>{Typeset`initDone$$},
    UntrackedVariables:>{Typeset`size$$}], "Manipulate",
   Deployed->True,
   StripOnInput->False],
  Manipulate`InterpretManipulate[1]]], "Output",
 CellChangeTimes->{
  3.8856217428819695`*^9, 3.8858855419140024`*^9, 3.886656787069237*^9, 
   3.887770977042303*^9, 3.887941862784433*^9, 3.8881450981256533`*^9, 
   3.8883037365364037`*^9, 3.8916612214852233`*^9, 3.922499063666712*^9, 
   3.9235675771284513`*^9, 3.923623760342407*^9, {3.9236238787796493`*^9, 
   3.9236238896389337`*^9}, 3.924583030289374*^9, 3.9263931740051208`*^9, 
   3.926393687819787*^9, 3.9269978998617516`*^9, 3.9270838811052837`*^9, 
   3.927085590667444*^9, 3.9270868472409954`*^9},
 CellLabel->
  "Out[334]=",ExpressionUUID->"0691aafb-e958-4f9b-a2ed-ba40d2e0989f"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
   "We", " ", "now", " ", "consider", " ", "other", " ", "cases", " ", "for", 
    " ", "the", " ", "participation", " ", "constraint", " ", 
    RowBox[{"binding", ".", "\[IndentingNewLine]", "Since"}], " ", "the", " ",
     "derivative", " ", "of", " ", "the", " ", "payoffs", " ", "with", " ", 
    "respect", " ", "to", " ", "\[Theta]", " ", "is", " ", "equal", " ", "to",
     " ", "the", " ", "sum", " ", "of", " ", 
    RowBox[{"quantities", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"q1sol", "+", "q2sol", "-", "qe2"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{"%", "\[Equal]", "0"}], ",", "\[Theta]"}], "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"FullSimplify", "[", 
    RowBox[{"Reduce", "[", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"%", "<", 
        RowBox[{"-", "d"}]}], ",", 
       RowBox[{"1", ">", "c", ">", "0"}], ",", 
       RowBox[{"1", ">", "\[Gamma]", ">", "0"}], ",", 
       RowBox[{"1", ">", "d", ">", "0"}]}], "}"}], "]"}], "]"}], 
   "\[IndentingNewLine]", 
   RowBox[{"Doutside", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{"%%", "\[Equal]", 
         RowBox[{"-", "d"}]}], ",", "d"}], "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.9235676416075363`*^9, 3.923567654564291*^9}, {
   3.9235676921829944`*^9, 3.9235678384530478`*^9}, {3.9236239069223285`*^9, 
   3.9236239229188995`*^9}, {3.923624014395379*^9, 3.9236240310887885`*^9}, 
   3.9263931824778996`*^9, 3.927084932145732*^9},
 CellLabel->"In[29]:=",ExpressionUUID->"561c02b4-cff2-481a-815d-fa6b65619bb0"],

Cell[BoxData[
 RowBox[{
  RowBox[{"(", 
   RowBox[{
    RowBox[{"0", "<", "c", "<", 
     FractionBox["4", "5"]}], "&&", 
    RowBox[{"\[Gamma]", ">", "0"}], "&&", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"(", 
       RowBox[{
        RowBox[{"c", "<", 
         RowBox[{"4", " ", "d"}]}], "&&", 
        RowBox[{
         RowBox[{"5", " ", "d"}], "<", "1"}], "&&", 
        RowBox[{"\[Gamma]", "<", 
         FractionBox[
          RowBox[{
           RowBox[{"-", "1"}], "+", 
           RowBox[{"5", " ", "d"}]}], 
          RowBox[{
           RowBox[{"-", "1"}], "+", "c", "+", "d"}]]}]}], ")"}], "||", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"d", ">", "0"}], "&&", 
        RowBox[{"c", "\[GreaterEqual]", 
         RowBox[{"4", " ", "d"}]}], "&&", 
        RowBox[{"\[Gamma]", "<", "1"}]}], ")"}]}], ")"}]}], ")"}], "||", 
  RowBox[{"(", 
   RowBox[{
    RowBox[{
     RowBox[{"5", " ", "c"}], "\[Equal]", "4"}], "&&", 
    RowBox[{"0", "<", "d", "<", 
     FractionBox["1", "5"]}], "&&", 
    RowBox[{"0", "<", "\[Gamma]", "<", "1"}]}], ")"}], "||", 
  RowBox[{"(", 
   RowBox[{
    RowBox[{
     FractionBox["4", "5"], "<", "c", "<", "1"}], "&&", 
    RowBox[{"\[Gamma]", "<", "1"}], "&&", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"(", 
       RowBox[{
        RowBox[{"d", ">", "0"}], "&&", 
        RowBox[{"\[Gamma]", ">", "0"}], "&&", 
        RowBox[{
         RowBox[{"5", " ", "d"}], "\[LessEqual]", "1"}]}], ")"}], "||", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"c", ">", 
         RowBox[{"4", " ", "d"}]}], "&&", 
        RowBox[{
         RowBox[{"5", " ", "d"}], ">", "1"}], "&&", 
        RowBox[{
         FractionBox[
          RowBox[{
           RowBox[{"-", "1"}], "+", 
           RowBox[{"5", " ", "d"}]}], 
          RowBox[{
           RowBox[{"-", "1"}], "+", "c", "+", "d"}]], "<", "\[Gamma]"}]}], 
       ")"}]}], ")"}]}], ")"}]}]], "Output",
 CellChangeTimes->{{3.923567834144353*^9, 3.9235678402035713`*^9}, 
   3.923624033538211*^9, 3.9245830307370725`*^9, 3.9263931831286745`*^9, 
   3.9269979003152504`*^9, 3.9270838814132547`*^9, 3.9270849330830584`*^9, 
   3.927085591926134*^9},
 CellLabel->"Out[31]=",ExpressionUUID->"c8bf85ff-8cc1-45fb-a50b-919679c2007d"],

Cell[BoxData[
 FractionBox[
  RowBox[{
   RowBox[{"-", "1"}], "+", "\[Gamma]", "-", 
   RowBox[{"c", " ", "\[Gamma]"}]}], 
  RowBox[{
   RowBox[{"-", "5"}], "+", "\[Gamma]"}]]], "Output",
 CellChangeTimes->{{3.923567834144353*^9, 3.9235678402035713`*^9}, 
   3.923624033538211*^9, 3.9245830307370725`*^9, 3.9263931831286745`*^9, 
   3.9269979003152504`*^9, 3.9270838814132547`*^9, 3.9270849330830584`*^9, 
   3.927085592026801*^9},
 CellLabel->"Out[32]=",ExpressionUUID->"0c6b7fb1-d64e-44cd-a41c-8f3c7d73ff4a"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"{", 
   RowBox[{"Dq2sol", ",", "Doutside"}], "}"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"Manipulate", "[", 
  RowBox[{
   RowBox[{"Plot", "[", 
    RowBox[{"%", ",", 
     RowBox[{"{", 
      RowBox[{"\[Gamma]", ",", "0", ",", "1"}], "}"}], ",", 
     RowBox[{"PlotRange", "\[Rule]", 
      RowBox[{"{", 
       RowBox[{"0", ",", "1"}], "}"}]}]}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"c", ",", "0.1"}], "}"}], ",", "0", ",", "1"}], "}"}]}], 
  "]"}]}], "Input",
 CellChangeTimes->{{3.885886809163655*^9, 3.8858868155956078`*^9}},
 CellLabel->"In[34]:=",ExpressionUUID->"125bac28-f722-461e-8abd-59078715c59b"],

Cell[BoxData[
 TagBox[
  StyleBox[
   DynamicModuleBox[{$CellContext`c$$ = 0.1, Typeset`show$$ = True, 
    Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", 
    Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = 
    "\"untitled\"", Typeset`specs$$ = {{{
       Hold[$CellContext`c$$], 0.1}, 0, 1}}, Typeset`size$$ = {
    360., {116., 120.24657259881528`}}, Typeset`update$$ = 0, 
    Typeset`initDone$$, Typeset`skipInitDone$$ = True}, 
    DynamicBox[Manipulate`ManipulateBoxes[
     1, StandardForm, "Variables" :> {$CellContext`c$$ = 0.1}, 
      "ControllerVariables" :> {}, 
      "OtherVariables" :> {
       Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, 
        Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, 
        Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$,
         Typeset`skipInitDone$$}, "Body" :> 
      Plot[{Rational[
          1, 3] (-1 + $CellContext`\[Gamma])^(-1) (-1 + $CellContext`c$$ + \
$CellContext`\[Gamma]), (-5 + $CellContext`\[Gamma])^(-1) (-1 + $CellContext`\
\[Gamma] - $CellContext`c$$ $CellContext`\[Gamma])}, {$CellContext`\[Gamma], 
         0, 1}, PlotRange -> {0, 1}], 
      "Specifications" :> {{{$CellContext`c$$, 0.1}, 0, 1}}, "Options" :> {}, 
      "DefaultOptions" :> {}],
     ImageSizeCache->{817., {145., 151.}},
     SingleEvaluation->True],
    Deinitialization:>None,
    DynamicModuleValues:>{},
    SynchronousInitialization->True,
    UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$},
    UnsavedVariables:>{Typeset`initDone$$},
    UntrackedVariables:>{Typeset`size$$}], "Manipulate",
   Deployed->True,
   StripOnInput->False],
  Manipulate`InterpretManipulate[1]]], "Output",
 CellChangeTimes->{3.8858868165300417`*^9, 3.886656787954837*^9, 
  3.8877709787781954`*^9, 3.8879418636454287`*^9, 3.8881450988932195`*^9, 
  3.8883037374135456`*^9, 3.8916612219686832`*^9, 3.9224990639480147`*^9, 
  3.923567849881178*^9, 3.923624036373764*^9, 3.924583030759185*^9, 
  3.926997900371175*^9, 3.9270838814561167`*^9, 3.927085592162895*^9},
 CellLabel->"Out[35]=",ExpressionUUID->"07169751-4c2d-4a97-b5b5-7b74af4c7574"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{"FullSimplify", "[", 
  RowBox[{"D", "[", 
   RowBox[{"Usol", ",", "\[Theta]"}], "]"}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"FullSimplify", "[", 
  RowBox[{"D", "[", 
   RowBox[{"VR", ",", "\[Theta]"}], "]"}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"Factor", "[", 
  RowBox[{"%%", "-", "%"}], "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{
      RowBox[{"Numerator", "[", "%", "]"}], ">", "0"}], ",", 
     RowBox[{
      RowBox[{"1", "-", "c"}], ">", "d", ">", "0"}], ",", 
     RowBox[{
      RowBox[{"1", "/", "2"}], ">", "c", ">", "0"}], ",", 
     RowBox[{"1", ">", "\[Gamma]", ">", "0"}]}], "}"}], "/.", 
   RowBox[{"\[Theta]", "->", " ", 
    RowBox[{"1", "-", "d"}]}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"Reduce", "[", "%", "]"}]}], "Input",
 CellChangeTimes->{{3.8853570599561777`*^9, 3.8853571552421494`*^9}, {
  3.8853571853005033`*^9, 3.885357198496953*^9}, {3.885357232514058*^9, 
  3.8853573310709233`*^9}},
 CellLabel->"In[36]:=",ExpressionUUID->"957cff9a-208c-47e7-935f-a1fbdf994974"],

Cell[BoxData[
 FractionBox[
  RowBox[{"2", "-", "c", "-", 
   RowBox[{"2", " ", "d"}], "+", 
   RowBox[{"4", " ", "\[Theta]"}]}], 
  RowBox[{"1", "+", "\[Gamma]"}]]], "Output",
 CellChangeTimes->{{3.885357074205699*^9, 3.885357101709092*^9}, 
   3.8853571565546417`*^9, 3.885357199578573*^9, {3.8853572345483255`*^9, 
   3.8853572688574944`*^9}, {3.885357305474341*^9, 3.8853573317866383`*^9}, 
   3.8858858517450066`*^9, 3.886656788091675*^9, 3.887770978961683*^9, 
   3.8879418636554413`*^9, 3.8881450989733343`*^9, 3.8883037375441256`*^9, 
   3.891661222035554*^9, 3.9224990639480147`*^9, 3.9235678589580574`*^9, 
   3.9245830307748575`*^9, 3.926997900407055*^9, 3.927083881542267*^9, 
   3.9270855922583265`*^9},
 CellLabel->"Out[36]=",ExpressionUUID->"7946d73f-5c59-4dcd-bcfa-7d699d60a764"],

Cell[BoxData[
 RowBox[{"1", "-", "c", "+", "\[Theta]"}]], "Output",
 CellChangeTimes->{{3.885357074205699*^9, 3.885357101709092*^9}, 
   3.8853571565546417`*^9, 3.885357199578573*^9, {3.8853572345483255`*^9, 
   3.8853572688574944`*^9}, {3.885357305474341*^9, 3.8853573317866383`*^9}, 
   3.8858858517450066`*^9, 3.886656788091675*^9, 3.887770978961683*^9, 
   3.8879418636554413`*^9, 3.8881450989733343`*^9, 3.8883037375441256`*^9, 
   3.891661222035554*^9, 3.9224990639480147`*^9, 3.9235678589580574`*^9, 
   3.9245830307748575`*^9, 3.926997900407055*^9, 3.927083881542267*^9, 
   3.927085592264311*^9},
 CellLabel->"Out[37]=",ExpressionUUID->"c435b3cd-da9a-4718-8b1f-c1d719d39c0a"],

Cell[BoxData[
 FractionBox[
  RowBox[{"1", "-", 
   RowBox[{"2", " ", "d"}], "-", "\[Gamma]", "+", 
   RowBox[{"c", " ", "\[Gamma]"}], "+", 
   RowBox[{"3", " ", "\[Theta]"}], "-", 
   RowBox[{"\[Gamma]", " ", "\[Theta]"}]}], 
  RowBox[{"1", "+", "\[Gamma]"}]]], "Output",
 CellChangeTimes->{{3.885357074205699*^9, 3.885357101709092*^9}, 
   3.8853571565546417`*^9, 3.885357199578573*^9, {3.8853572345483255`*^9, 
   3.8853572688574944`*^9}, {3.885357305474341*^9, 3.8853573317866383`*^9}, 
   3.8858858517450066`*^9, 3.886656788091675*^9, 3.887770978961683*^9, 
   3.8879418636554413`*^9, 3.8881450989733343`*^9, 3.8883037375441256`*^9, 
   3.891661222035554*^9, 3.9224990639480147`*^9, 3.9235678589580574`*^9, 
   3.9245830307748575`*^9, 3.926997900407055*^9, 3.927083881542267*^9, 
   3.9270855922672973`*^9},
 CellLabel->"Out[38]=",ExpressionUUID->"f563fccc-d2a0-41af-bd0d-feeee9be0554"],

Cell[BoxData[
 RowBox[{
  RowBox[{"(", 
   RowBox[{
    RowBox[{"0", "<", "d", "\[LessEqual]", 
     FractionBox["1", "2"]}], "&&", 
    RowBox[{"0", "<", "c", "<", 
     FractionBox["1", "2"]}], "&&", 
    RowBox[{"0", "<", "\[Gamma]", "<", "1"}]}], ")"}], "||", 
  RowBox[{"(", 
   RowBox[{
    RowBox[{
     FractionBox["1", "2"], "<", "d", "\[LessEqual]", 
     FractionBox["3", "5"]}], "&&", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"(", 
       RowBox[{
        RowBox[{"0", "<", "c", "<", 
         RowBox[{
          RowBox[{"-", "2"}], "+", 
          RowBox[{"4", " ", "d"}]}]}], "&&", 
        RowBox[{"0", "<", "\[Gamma]", "<", 
         FractionBox[
          RowBox[{
           RowBox[{"-", "4"}], "+", 
           RowBox[{"5", " ", "d"}]}], 
          RowBox[{
           RowBox[{"-", "2"}], "+", "c", "+", "d"}]]}]}], ")"}], "||", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{
         RowBox[{
          RowBox[{"-", "2"}], "+", 
          RowBox[{"4", " ", "d"}]}], "\[LessEqual]", "c", "<", 
         RowBox[{"1", "-", "d"}]}], "&&", 
        RowBox[{"0", "<", "\[Gamma]", "<", "1"}]}], ")"}]}], ")"}]}], ")"}], "||", 
  RowBox[{"(", 
   RowBox[{
    RowBox[{
     FractionBox["3", "5"], "<", "d", "<", 
     FractionBox["4", "5"]}], "&&", 
    RowBox[{"0", "<", "c", "<", 
     RowBox[{"1", "-", "d"}]}], "&&", 
    RowBox[{"0", "<", "\[Gamma]", "<", 
     FractionBox[
      RowBox[{
       RowBox[{"-", "4"}], "+", 
       RowBox[{"5", " ", "d"}]}], 
      RowBox[{
       RowBox[{"-", "2"}], "+", "c", "+", "d"}]]}]}], ")"}]}]], "Output",
 CellChangeTimes->{{3.885357074205699*^9, 3.885357101709092*^9}, 
   3.8853571565546417`*^9, 3.885357199578573*^9, {3.8853572345483255`*^9, 
   3.8853572688574944`*^9}, {3.885357305474341*^9, 3.8853573317866383`*^9}, 
   3.8858858517450066`*^9, 3.886656788091675*^9, 3.887770978961683*^9, 
   3.8879418636554413`*^9, 3.8881450989733343`*^9, 3.8883037375441256`*^9, 
   3.891661222035554*^9, 3.9224990639480147`*^9, 3.9235678589580574`*^9, 
   3.9245830307748575`*^9, 3.926997900407055*^9, 3.927083881542267*^9, 
   3.927085592271283*^9},
 CellLabel->"Out[40]=",ExpressionUUID->"967fccb2-8b5d-4534-8a46-e69831f5819f"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"1", "+", "d"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"1", "-", "d"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"{", 
    RowBox[{"Usol", ",", "VR"}], "}"}], "/.", 
   RowBox[{
    TemplateBox[{"1"},
     "C"], "\[Rule]", "fixedfee"}]}], "/.", 
  RowBox[{"{", 
   RowBox[{
    RowBox[{"c", "\[Rule]", "0.1"}], ",", 
    RowBox[{"d", "\[Rule]", "0.1"}], ",", 
    RowBox[{"\[Gamma]", "\[Rule]", "0.6"}]}], "}"}]}], "\[IndentingNewLine]", 
 RowBox[{"Manipulate", "[", 
  RowBox[{
   RowBox[{"Plot", "[", 
    RowBox[{"%", ",", 
     RowBox[{"{", 
      RowBox[{"\[Theta]", ",", "%%", ",", "%%%"}], "}"}]}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"c", ",", "0.1"}], "}"}], ",", "0", ",", 
     RowBox[{"1", "/", "2"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"d", ",", "0.1"}], "}"}], ",", "0", ",", "1"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"\[Gamma]", ",", "0.3"}], "}"}], ",", "0", ",", "1"}], "}"}]}], 
  "]"}]}], "Input",
 CellChangeTimes->{{3.885357384251141*^9, 3.8853575041472054`*^9}, {
   3.885357549656909*^9, 3.885357588817388*^9}, {3.885357631040969*^9, 
   3.8853576394561815`*^9}, {3.885885900810672*^9, 3.8858859210898914`*^9}, 
   3.9270867853276606`*^9},
 CellLabel->
  "In[335]:=",ExpressionUUID->"57d03ba2-85d3-4de1-9723-82285265f091"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"0.41375000000000006`", "\[VeryThinSpace]", "+", 
    RowBox[{"0.625`", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"1.7`", " ", "\[Theta]"}], "+", 
       RowBox[{"2", " ", 
        SuperscriptBox["\[Theta]", "2"]}]}], ")"}]}]}], ",", 
   RowBox[{
    FractionBox["1", "2"], " ", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{"0.9`", "\[VeryThinSpace]", "+", "\[Theta]"}], ")"}], "2"]}]}], 
  "}"}]], "Output",
 CellChangeTimes->{{3.885357471422229*^9, 3.8853575049506836`*^9}, {
   3.885357560430612*^9, 3.8853575896177673`*^9}, {3.885357632385007*^9, 
   3.885357640339758*^9}, {3.885885912603258*^9, 3.8858859218068943`*^9}, 
   3.8866567882741475`*^9, 3.887770979179639*^9, 3.887941863771346*^9, 
   3.8881450990639863`*^9, 3.888303737731611*^9, 3.8916612220836267`*^9, 
   3.9224990639858065`*^9, 3.9235678715302563`*^9, 3.924583030790472*^9, 
   3.9269979004529033`*^9, 3.9270838815980797`*^9, 3.927085592376293*^9, 
   3.927086785847012*^9, 3.927086861185791*^9},
 CellLabel->
  "Out[337]=",ExpressionUUID->"091ae2e9-673d-4faa-8f05-ccb8348935c5"],

Cell[BoxData[
 TagBox[
  StyleBox[
   DynamicModuleBox[{$CellContext`c$$ = 0.1, $CellContext`d$$ = 
    0.1, $CellContext`\[Gamma]$$ = 0.3, Typeset`show$$ = True, 
    Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", 
    Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = 
    "\"untitled\"", Typeset`specs$$ = {{{
       Hold[$CellContext`c$$], 0.1}, 0, 
      Rational[1, 2]}, {{
       Hold[$CellContext`d$$], 0.1}, 0, 1}, {{
       Hold[$CellContext`\[Gamma]$$], 0.3}, 0, 1}}, Typeset`size$$ = {
    360., {107., 111.81441188891381`}}, Typeset`update$$ = 0, 
    Typeset`initDone$$, Typeset`skipInitDone$$ = True}, 
    DynamicBox[Manipulate`ManipulateBoxes[
     1, StandardForm, 
      "Variables" :> {$CellContext`c$$ = 0.1, $CellContext`d$$ = 
        0.1, $CellContext`\[Gamma]$$ = 0.3}, "ControllerVariables" :> {}, 
      "OtherVariables" :> {
       Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, 
        Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, 
        Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$,
         Typeset`skipInitDone$$}, "Body" :> 
      Plot[{0.41375000000000006` + 
         0.625 (1.7 $CellContext`\[Theta] + 2 $CellContext`\[Theta]^2), 
         Rational[
          1, 2] (0.9 + $CellContext`\[Theta])^2}, {$CellContext`\[Theta], 
         1 - $CellContext`d$$, 1 + $CellContext`d$$}], 
      "Specifications" :> {{{$CellContext`c$$, 0.1}, 0, 
         Rational[1, 2]}, {{$CellContext`d$$, 0.1}, 0, 
         1}, {{$CellContext`\[Gamma]$$, 0.3}, 0, 1}}, "Options" :> {}, 
      "DefaultOptions" :> {}],
     ImageSizeCache->{817., {136., 142.}},
     SingleEvaluation->True],
    Deinitialization:>None,
    DynamicModuleValues:>{},
    SynchronousInitialization->True,
    UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$},
    UnsavedVariables:>{Typeset`initDone$$},
    UntrackedVariables:>{Typeset`size$$}], "Manipulate",
   Deployed->True,
   StripOnInput->False],
  Manipulate`InterpretManipulate[1]]], "Output",
 CellChangeTimes->{{3.885357471422229*^9, 3.8853575049506836`*^9}, {
   3.885357560430612*^9, 3.8853575896177673`*^9}, {3.885357632385007*^9, 
   3.885357640339758*^9}, {3.885885912603258*^9, 3.8858859218068943`*^9}, 
   3.8866567882741475`*^9, 3.887770979179639*^9, 3.887941863771346*^9, 
   3.8881450990639863`*^9, 3.888303737731611*^9, 3.8916612220836267`*^9, 
   3.9224990639858065`*^9, 3.9235678715302563`*^9, 3.924583030790472*^9, 
   3.9269979004529033`*^9, 3.9270838815980797`*^9, 3.927085592376293*^9, 
   3.927086785847012*^9, 3.9270868612969465`*^9},
 CellLabel->
  "Out[338]=",ExpressionUUID->"687ab5c4-67e7-4f23-b754-a500ba1a0911"]
}, Open  ]],

Cell[BoxData[""], "Input",
 CellChangeTimes->{{3.9235678761241565`*^9, 3.9235679116957483`*^9}},
 CellLabel->"In[45]:=",ExpressionUUID->"2eb657e1-d8c2-4135-bb1a-05c54bf452ca"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
   "Now", " ", "we", " ", "implement", " ", "the", " ", "quantities", " ", 
    "and", " ", "derive", " ", "the", " ", "optimal", " ", 
    RowBox[{"tariff", "."}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{"q1ind", "-", "q1sol"}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", "0"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"q1ind", "-", "q1sol", "-", 
      RowBox[{"(", "%", ")"}]}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", "1"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"q2ind", "-", "q2sol"}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", "0"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"q2ind", "-", "q2sol", "-", 
      RowBox[{"(", "%", ")"}]}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", "1"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{
      RowBox[{"%", "\[Equal]", "0"}], ",", 
      RowBox[{"%%", "\[Equal]", "0"}], ",", 
      RowBox[{"%%%", "\[Equal]", "0"}], ",", 
      RowBox[{"%%%%", "\[Equal]", "0"}]}], "}"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"contr", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{"%", ",", 
        RowBox[{"{", 
         RowBox[{"a1", ",", "a2", ",", "b1", ",", "b2"}], "}"}]}], "]"}], 
      "]"}], "[", 
     RowBox[{"[", "1", "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.923567913632536*^9, 3.923567913955841*^9}},
 CellLabel->"In[46]:=",ExpressionUUID->"2452af80-4c35-47f3-bafb-c9cd0d5ca008"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"a1", "\[Rule]", 
    FractionBox[
     RowBox[{"1", "+", "d", "+", 
      RowBox[{
       RowBox[{"(", 
        RowBox[{
         RowBox[{"-", "1"}], "+", "c"}], ")"}], " ", "\[Gamma]"}], "-", 
      RowBox[{"d", " ", "\[Gamma]"}]}], 
     RowBox[{"2", "-", 
      RowBox[{"2", " ", "\[Gamma]"}]}]]}], ",", 
   RowBox[{"a2", "\[Rule]", 
    RowBox[{
     FractionBox["1", "4"], " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "-", "\[Gamma]"}], ")"}]}]}], ",", 
   RowBox[{"b1", "\[Rule]", 
    RowBox[{
     FractionBox["1", "2"], " ", 
     RowBox[{"(", 
      RowBox[{"1", "+", "d", "+", 
       RowBox[{"c", " ", 
        RowBox[{"(", 
         RowBox[{"2", "+", 
          FractionBox["1", 
           RowBox[{
            RowBox[{"-", "1"}], "+", "\[Gamma]"}]]}], ")"}]}]}], ")"}]}]}], 
   ",", 
   RowBox[{"b2", "\[Rule]", 
    RowBox[{
     FractionBox["1", "4"], " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "-", "\[Gamma]"}], ")"}]}]}]}], "}"}]], "Output",
 CellChangeTimes->{3.885886536820607*^9, 3.885886581198958*^9, 
  3.8865652533335238`*^9, 3.886656788645789*^9, 3.8877709798691187`*^9, 
  3.887941864034404*^9, 3.888145099280102*^9, 3.8883037381506743`*^9, 
  3.891661222340778*^9, 3.922499064086191*^9, 3.923567915105014*^9, 
  3.923624147668488*^9, 3.9245830308595476`*^9, 3.9263931917724037`*^9, 
  3.926997900580047*^9, 3.9270838817814674`*^9, 3.927085592791235*^9},
 CellLabel->"Out[51]=",ExpressionUUID->"0399963d-10dd-4cd1-87c1-6cb69640924c"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
    "And", " ", "we", " ", "determine", " ", "the", " ", "fixed", " ", "fee", 
     " ", 
     RowBox[{"(", 
      RowBox[{
      "in", " ", "the", " ", "case", " ", "for", " ", "the", " ", 
       "particpation", " ", "binding", " ", "only", " ", "for", " ", "the", 
       " ", "lowest", " ", "type"}], ")"}]}], ":"}], "*)"}], 
  "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{"FullSimplify", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"u", "-", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"a1", " ", "q1"}], "+", 
         RowBox[{"a2", " ", 
          RowBox[{"q1", "^", "2"}]}], "+", 
         RowBox[{"b1", " ", "q2"}], "+", 
         RowBox[{"b2", " ", 
          RowBox[{"q2", "^", "2"}]}]}], ")"}], "-", "K"}], "/.", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"q1", "\[Rule]", "q1sol"}], ",", 
        RowBox[{"q2", "\[Rule]", "q2sol"}]}], "}"}]}], "/.", "contr"}], "]"}],
    "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"0", "==", 
      RowBox[{"%", "-", "VR"}]}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", 
      RowBox[{"-", "d"}]}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"Ksol", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{"%", ",", "K"}], "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.8853787666748123`*^9, 3.885378791137733*^9}, {
   3.885378825805603*^9, 3.885378915485387*^9}, {3.885379084563111*^9, 
   3.8853790865305967`*^9}, {3.8858866116190834`*^9, 
   3.8858866168050847`*^9}, {3.9235679252353044`*^9, 
   3.9235679378194385`*^9}, {3.923624185542328*^9, 3.9236241999138527`*^9}, 
   3.9263931965220747`*^9},
 CellLabel->
  "In[339]:=",ExpressionUUID->"fb2a9037-0707-49e7-a8f2-70972d29c120"],

Cell[BoxData[
 FractionBox[
  RowBox[{
   RowBox[{
    RowBox[{"-", 
     SuperscriptBox["c", "2"]}], " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", 
      RowBox[{"\[Gamma]", " ", 
       RowBox[{"(", 
        RowBox[{"2", "+", "\[Gamma]"}], ")"}]}]}], ")"}]}], "+", 
   RowBox[{"2", " ", "c", " ", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], "2"], " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "d", "-", 
      RowBox[{"2", " ", "\[Theta]"}]}], ")"}]}], "+", 
   RowBox[{"2", " ", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], "2"], " ", 
    RowBox[{"(", 
     RowBox[{
      SuperscriptBox["d", "2"], "-", 
      RowBox[{"2", " ", "K", " ", 
       RowBox[{"(", 
        RowBox[{"1", "+", "\[Gamma]"}], ")"}]}], "-", 
      RowBox[{"2", " ", "d", " ", 
       RowBox[{"(", 
        RowBox[{"1", "+", 
         RowBox[{"2", " ", "\[Theta]"}]}], ")"}]}], "+", 
      SuperscriptBox[
       RowBox[{"(", 
        RowBox[{"1", "+", 
         RowBox[{"2", " ", "\[Theta]"}]}], ")"}], "2"]}], ")"}]}]}], 
  RowBox[{"4", " ", 
   SuperscriptBox[
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], "2"], " ", 
   RowBox[{"(", 
    RowBox[{"1", "+", "\[Gamma]"}], ")"}]}]]], "Output",
 CellChangeTimes->{
  3.885378840280125*^9, {3.885378895756245*^9, 3.8853789159151707`*^9}, 
   3.885379087143176*^9, 3.885886626231343*^9, 3.886565269177297*^9, 
   3.8866567892940207`*^9, 3.8877709805693254`*^9, 3.88794186451978*^9, 
   3.888145099717672*^9, 3.888303738515847*^9, 3.8916612226918273`*^9, 
   3.922499064309308*^9, 3.9235679411022377`*^9, 3.9236241527189093`*^9, 
   3.9236242019595575`*^9, 3.9245830310528946`*^9, 3.9263931976599164`*^9, 
   3.926997900872593*^9, 3.9269982414586015`*^9, 3.927083882049102*^9, 
   3.9270855936418486`*^9, 3.92708686843356*^9},
 CellLabel->
  "Out[339]=",ExpressionUUID->"6b2d65b3-a229-4eb9-8066-fdf6cac93392"],

Cell[BoxData[
 RowBox[{
  FractionBox["1", "8"], " ", 
  RowBox[{"(", 
   RowBox[{
    RowBox[{
     RowBox[{"-", "4"}], " ", 
     SuperscriptBox[
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "1"}], "+", "c", "+", "d"}], ")"}], "2"]}], "-", 
    FractionBox[
     RowBox[{"2", " ", 
      SuperscriptBox["c", "2"]}], 
     SuperscriptBox[
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], "2"]], "-", 
    FractionBox[
     RowBox[{"3", " ", 
      SuperscriptBox["c", "2"]}], 
     RowBox[{
      RowBox[{"-", "1"}], "+", "\[Gamma]"}]], "+", 
    FractionBox[
     SuperscriptBox[
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "2"}], "+", "c", "+", 
        RowBox[{"6", " ", "d"}]}], ")"}], "2"], 
     RowBox[{"1", "+", "\[Gamma]"}]]}], ")"}]}]], "Output",
 CellChangeTimes->{
  3.885378840280125*^9, {3.885378895756245*^9, 3.8853789159151707`*^9}, 
   3.885379087143176*^9, 3.885886626231343*^9, 3.886565269177297*^9, 
   3.8866567892940207`*^9, 3.8877709805693254`*^9, 3.88794186451978*^9, 
   3.888145099717672*^9, 3.888303738515847*^9, 3.8916612226918273`*^9, 
   3.922499064309308*^9, 3.9235679411022377`*^9, 3.9236241527189093`*^9, 
   3.9236242019595575`*^9, 3.9245830310528946`*^9, 3.9263931976599164`*^9, 
   3.926997900872593*^9, 3.9269982414586015`*^9, 3.927083882049102*^9, 
   3.9270855936418486`*^9, 3.927086869023582*^9},
 CellLabel->
  "Out[341]=",ExpressionUUID->"ee81ef62-d0a2-4889-a23f-8f9aa4d5be1c"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"In", " ", "the", " ", "\"\<uncsontrained\>\"", " ", 
    RowBox[{"(", 
     RowBox[{
     "that", " ", "is", " ", "there", " ", "are", " ", "no", " ", "corner", 
      " ", "solutions"}], ")"}], " ", "case", " ", "the", " ", "profits", " ",
     "of", " ", "RB", " ", 
    RowBox[{"are", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"(", 
         RowBox[{
          RowBox[{"a1", " ", "q1"}], "+", 
          RowBox[{"a2", " ", 
           RowBox[{"q1", "^", "2"}]}], "+", 
          RowBox[{"b1", " ", "q2"}], "+", 
          RowBox[{"b2", " ", 
           RowBox[{"q2", "^", "2"}]}]}], ")"}], "-", 
        RowBox[{"c", " ", "q2"}], "+", "Ksol"}], "/.", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"q1", "\[Rule]", "q1sol"}], ",", 
         RowBox[{"q2", "\[Rule]", "q2sol"}]}], "}"}]}], "/.", "contr"}], 
     "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Integrate", "[", 
     RowBox[{
      RowBox[{"%", " ", "f"}], ",", 
      RowBox[{"{", 
       RowBox[{"\[Theta]", ",", 
        RowBox[{"-", "d"}], ",", "d"}], "}"}]}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"ProfitRBunconstr", "=", 
    RowBox[{"FullSimplify", "[", "%", "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.8865654077527866`*^9, 3.8865655261786394`*^9}, {
  3.8865658087108603`*^9, 3.8865658110260277`*^9}, {3.9235679547676954`*^9, 
  3.9235679682059517`*^9}, {3.923624217964594*^9, 3.923624229362217*^9}, {
  3.9263933120329638`*^9, 3.926393314291893*^9}},
 CellLabel->
  "In[342]:=",ExpressionUUID->"b3ded18c-d905-4936-878c-877ce976b29d"],

Cell[BoxData[
 FractionBox[
  RowBox[{
   RowBox[{"-", "3"}], "+", 
   RowBox[{"6", " ", "d"}], "-", 
   RowBox[{"11", " ", 
    SuperscriptBox["d", "2"]}], "+", 
   RowBox[{"2", " ", 
    RowBox[{"(", 
     RowBox[{"3", "+", 
      RowBox[{"3", " ", "c", " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"-", "1"}], "+", "d"}], ")"}]}], "+", 
      RowBox[{"d", " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"-", "6"}], "+", 
         RowBox[{"7", " ", "d"}]}], ")"}]}]}], ")"}], " ", "\[Gamma]"}], "-", 
   RowBox[{"3", " ", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "c", "+", "d"}], ")"}], "2"], " ", 
    SuperscriptBox["\[Gamma]", "2"]}]}], 
  RowBox[{"6", " ", 
   RowBox[{"(", 
    RowBox[{
     RowBox[{"-", "1"}], "+", 
     SuperscriptBox["\[Gamma]", "2"]}], ")"}]}]]], "Output",
 CellChangeTimes->{
  3.8865654602493114`*^9, {3.886565503615088*^9, 3.8865655280996494`*^9}, 
   3.8866567908213882`*^9, 3.8877709822487493`*^9, 3.887941865437908*^9, 
   3.8881451007202826`*^9, 3.888303739567974*^9, 3.8916612237212715`*^9, 
   3.922499064950099*^9, 3.923567969176542*^9, 3.9236242091452885`*^9, 
   3.9245830315751705`*^9, 3.926393315679515*^9, 3.9269979017565384`*^9, 
   3.9270838836881695`*^9, 3.9270855963790197`*^9, 3.927086877183518*^9},
 CellLabel->
  "Out[344]=",ExpressionUUID->"27478b02-fb00-4d0e-94f8-0f472db6431d"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"And", " ", "the", " ", "Consumer", " ", 
    RowBox[{"surplus", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{
       RowBox[{"u", "-", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{"a1", " ", "q1"}], "+", 
          RowBox[{"a2", " ", 
           RowBox[{"q1", "^", "2"}]}], "+", 
          RowBox[{"b1", " ", "q2"}], "+", 
          RowBox[{"b2", " ", 
           RowBox[{"q2", "^", "2"}]}]}], ")"}], "-", "Ksol"}], "/.", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"q1", "\[Rule]", "q1sol"}], ",", 
         RowBox[{"q2", "\[Rule]", "q2sol"}]}], "}"}]}], "/.", "contr"}], 
     "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Integrate", "[", 
     RowBox[{
      RowBox[{"%", " ", "f"}], ",", 
      RowBox[{"{", 
       RowBox[{"\[Theta]", ",", 
        RowBox[{"-", "d"}], ",", "d"}], "}"}]}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"CSRBunconstr", "=", 
    RowBox[{"FullSimplify", "[", "%", "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.8880440713955045`*^9, 3.88804408935106*^9}, {
  3.9235679811521482`*^9, 3.9235679879079847`*^9}, {3.926393319506302*^9, 
  3.926393321671028*^9}},
 CellLabel->
  "In[345]:=",ExpressionUUID->"bd46d9c9-69b9-4a82-b9fb-9ecec9eb16dc"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   FractionBox["1", "2"], " ", 
   SuperscriptBox[
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "c", "+", "d"}], ")"}], "2"]}], "-", 
  FractionBox[
   RowBox[{"d", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "6"}], "+", 
      RowBox[{"3", " ", "c"}], "+", 
      RowBox[{"10", " ", "d"}]}], ")"}]}], 
   RowBox[{"3", " ", 
    RowBox[{"(", 
     RowBox[{"1", "+", "\[Gamma]"}], ")"}]}]]}]], "Output",
 CellChangeTimes->{3.888044096893857*^9, 3.888145101038308*^9, 
  3.8883037398781*^9, 3.891661224103572*^9, 3.922499065153596*^9, 
  3.923567988834792*^9, 3.923624235905219*^9, 3.924583031826023*^9, 
  3.9263933227825823`*^9, 3.9269979021042757`*^9, 3.9270838844693584`*^9, 
  3.9270855972332716`*^9, 3.9270868935830092`*^9},
 CellLabel->
  "Out[347]=",ExpressionUUID->"73069aa3-027b-4b7b-a5d1-607428c95fbb"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"Now", " ", "we", " ", "determin", " ", "the", " ", "Market"}], 
    "-", 
    RowBox[{
    "Share", " ", "price", " ", "tariff", " ", "that", " ", "implements", " ",
      "the", " ", "RB", " ", 
     RowBox[{"solution", ":"}]}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{"PMS", "=", 
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"a1", " ", "q1"}], "+", 
        RowBox[{"a2", " ", 
         RowBox[{"q1", "^", "2"}]}], "+", 
        RowBox[{"b1", " ", "q2"}], "+", 
        RowBox[{"b2", " ", 
         RowBox[{"q2", "^", "2"}]}], "-", 
        RowBox[{"c", " ", "q2"}]}], "/.", "contr"}], "/.", 
      RowBox[{"q2", "\[Rule]", 
       RowBox[{
        RowBox[{
         RowBox[{"(", 
          RowBox[{"1", "-", "s"}], ")"}], "/", "s"}], " ", "q1"}]}]}], 
     "]"}]}], "\[IndentingNewLine]", 
   RowBox[{"Collect", "[", 
    RowBox[{"PMS", ",", "q1", ",", "FullSimplify"}], "]"}]}]}]], "Input",
 CellChangeTimes->{{3.885359347947637*^9, 3.8853593829482384`*^9}, {
  3.8853594265843287`*^9, 3.885359521582756*^9}, {3.885376691350984*^9, 
  3.8853767032630186`*^9}, {3.885378172374205*^9, 3.885378199755*^9}, {
  3.885378249615713*^9, 3.885378250464522*^9}, {3.888306801346813*^9, 
  3.888306811165451*^9}, {3.8883068537406635`*^9, 3.8883068653177366`*^9}, {
  3.9235680113102007`*^9, 3.923568041754928*^9}, {3.923568094430744*^9, 
  3.923568100483741*^9}, {3.9235681630119724`*^9, 3.923568163544135*^9}},
 CellLabel->
  "In[348]:=",ExpressionUUID->"6b4460a3-c5ad-44d7-99d6-8e9274713271"],

Cell[BoxData[
 FractionBox[
  RowBox[{"q1", " ", 
   RowBox[{"(", 
    RowBox[{
     RowBox[{"2", " ", 
      RowBox[{"(", 
       RowBox[{"1", "+", "d"}], ")"}], " ", "s", " ", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}]}], "-", 
     RowBox[{"2", " ", "c", " ", "s", " ", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "1"}], "+", "s", "+", 
        RowBox[{"s", " ", "\[Gamma]"}]}], ")"}]}], "-", 
     RowBox[{"q1", " ", 
      RowBox[{"(", 
       RowBox[{"1", "+", 
        RowBox[{"2", " ", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", "1"}], "+", "s"}], ")"}], " ", "s"}]}], ")"}], " ", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "1"}], "+", 
        SuperscriptBox["\[Gamma]", "2"]}], ")"}]}]}], ")"}]}], 
  RowBox[{"4", " ", 
   SuperscriptBox["s", "2"], " ", 
   RowBox[{"(", 
    RowBox[{
     RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}]}]]], "Output",
 CellChangeTimes->{{3.8853594925462885`*^9, 3.885359522813792*^9}, 
   3.8853767422925606`*^9, 3.8858866489942245`*^9, 3.8865652829960403`*^9, 
   3.8866567912772446`*^9, 3.8877709829091277`*^9, 3.8879418657918262`*^9, 
   3.8881451014046717`*^9, 3.8883037403014216`*^9, 3.888306812008233*^9, 
   3.888306866518137*^9, 3.8916612244032507`*^9, 3.922499065299965*^9, {
   3.9235680382141542`*^9, 3.923568042503809*^9}, 3.9235681644625583`*^9, 
   3.9236242730370417`*^9, 3.9245830319187093`*^9, 3.926393330457569*^9, 
   3.926997902258772*^9, 3.9270838846212454`*^9, 3.927085597466237*^9, 
   3.9270868953066287`*^9},
 CellLabel->
  "Out[348]=",ExpressionUUID->"f09840fd-dbca-4eb3-885f-92ddedfd7ff7"],

Cell[BoxData[
 RowBox[{
  RowBox[{"-", 
   FractionBox[
    RowBox[{
     SuperscriptBox["q1", "2"], " ", 
     RowBox[{"(", 
      RowBox[{"1", "+", 
       RowBox[{"2", " ", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{"-", "1"}], "+", "s"}], ")"}], " ", "s"}]}], ")"}], " ", 
     RowBox[{"(", 
      RowBox[{"1", "+", "\[Gamma]"}], ")"}]}], 
    RowBox[{"4", " ", 
     SuperscriptBox["s", "2"]}]]}], "+", 
  FractionBox[
   RowBox[{"q1", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{
       RowBox[{"(", 
        RowBox[{"1", "+", "d"}], ")"}], " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}]}], "-", 
      RowBox[{"c", " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"-", "1"}], "+", "s", "+", 
         RowBox[{"s", " ", "\[Gamma]"}]}], ")"}]}]}], ")"}]}], 
   RowBox[{"2", " ", "s", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}]}]]}]], "Output",
 CellChangeTimes->{{3.8853594925462885`*^9, 3.885359522813792*^9}, 
   3.8853767422925606`*^9, 3.8858866489942245`*^9, 3.8865652829960403`*^9, 
   3.8866567912772446`*^9, 3.8877709829091277`*^9, 3.8879418657918262`*^9, 
   3.8881451014046717`*^9, 3.8883037403014216`*^9, 3.888306812008233*^9, 
   3.888306866518137*^9, 3.8916612244032507`*^9, 3.922499065299965*^9, {
   3.9235680382141542`*^9, 3.923568042503809*^9}, 3.9235681644625583`*^9, 
   3.9236242730370417`*^9, 3.9245830319187093`*^9, 3.926393330457569*^9, 
   3.926997902258772*^9, 3.9270838846212454`*^9, 3.927085597466237*^9, 
   3.9270868953375244`*^9},
 CellLabel->
  "Out[349]=",ExpressionUUID->"5a4f7574-de1e-4b08-aebf-08a97cf49290"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"Now", " ", "a", " ", "check", " ", "on", " ", "the", " ", 
    RowBox[{"implementation", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{"u", " ", "-", "PMS", "-", 
      RowBox[{"c", " ", "q2"}]}], "/.", 
     RowBox[{"q2", "\[Rule]", 
      RowBox[{
       RowBox[{
        RowBox[{"(", 
         RowBox[{"1", "-", "s"}], ")"}], "/", "s"}], " ", "q1"}]}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"FullSimplify", "[", 
    RowBox[{"Solve", "[", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{
        RowBox[{
         RowBox[{"D", "[", 
          RowBox[{"%", ",", "q1"}], "]"}], "\[Equal]", "0"}], ",", 
        RowBox[{
         RowBox[{"D", "[", 
          RowBox[{"%", ",", "s"}], "]"}], "\[Equal]", "0"}]}], "}"}], ",", 
      RowBox[{"{", 
       RowBox[{"q1", ",", "s"}], "}"}]}], "]"}], "]"}], "\[IndentingNewLine]",
    "\[IndentingNewLine]", 
   RowBox[{"MS", "=", 
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{"q1", "/", 
       RowBox[{"(", 
        RowBox[{"q1", "+", "q2"}], ")"}]}], "/.", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"q1", "\[Rule]", "q1sol"}], ",", 
        RowBox[{"q2", "\[Rule]", "q2sol"}]}], "}"}]}], "]"}]}], 
   "\[IndentingNewLine]", "\[IndentingNewLine]", 
   RowBox[{"FullSimplify", "[", 
    RowBox[{"MS", "-", 
     RowBox[{"%%", "[", 
      RowBox[{"[", 
       RowBox[{"1", ",", "2", ",", "2"}], "]"}], "]"}]}], "]"}]}]}]], "Input",
 CellChangeTimes->{{3.8853595103421926`*^9, 3.885359609705951*^9}, {
  3.885377466316296*^9, 3.8853774764783*^9}, {3.9235681158415174`*^9, 
  3.9235681567646627`*^9}, {3.923624315318143*^9, 3.9236243162037487`*^9}},
 CellLabel->
  "In[350]:=",ExpressionUUID->"6b676c48-2317-4993-a469-bc5166cf5cb4"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"q1", "\[Rule]", 
      FractionBox[
       RowBox[{
        RowBox[{"-", "1"}], "+", "d", "+", "\[Gamma]", "-", 
        RowBox[{"c", " ", "\[Gamma]"}], "-", 
        RowBox[{"d", " ", "\[Gamma]"}], "+", 
        RowBox[{"2", " ", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], " ", "\[Theta]"}]}], 
       RowBox[{
        RowBox[{"-", "1"}], "+", 
        SuperscriptBox["\[Gamma]", "2"]}]]}], ",", 
     RowBox[{"s", "\[Rule]", 
      RowBox[{
       FractionBox["1", "2"], " ", 
       RowBox[{"(", 
        RowBox[{"1", "+", 
         FractionBox[
          RowBox[{"c", " ", 
           RowBox[{"(", 
            RowBox[{"1", "+", "\[Gamma]"}], ")"}]}], 
          RowBox[{
           RowBox[{"(", 
            RowBox[{
             RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], " ", 
           RowBox[{"(", 
            RowBox[{
             RowBox[{"-", "2"}], "+", "c", "+", 
             RowBox[{"2", " ", "d"}], "-", 
             RowBox[{"4", " ", "\[Theta]"}]}], ")"}]}]]}], ")"}]}]}]}], "}"}],
    ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"q1", "\[Rule]", "0"}], ",", 
     RowBox[{"s", "\[Rule]", 
      FractionBox[
       RowBox[{
        RowBox[{"c", " ", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", "1"}], "+", 
           RowBox[{"2", " ", "\[Gamma]"}]}], ")"}]}], "+", 
        RowBox[{
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], " ", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", "1"}], "+", "d", "-", 
           RowBox[{"2", " ", "\[Theta]"}]}], ")"}]}]}], 
       RowBox[{"c", " ", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{"-", "1"}], "+", 
          RowBox[{"3", " ", "\[Gamma]"}]}], ")"}]}]]}]}], "}"}]}], 
  "}"}]], "Output",
 CellChangeTimes->{
  3.8853595634267073`*^9, 3.8853596110443425`*^9, 3.885377478968847*^9, 
   3.8858866532536387`*^9, 3.8866567914209375`*^9, 3.8877709830828943`*^9, 
   3.8879418658921323`*^9, 3.8881451014894104`*^9, 3.8883037403971148`*^9, 
   3.891661224568159*^9, 3.9224990653624754`*^9, 3.923568135643761*^9, 
   3.9235681737217474`*^9, {3.923624303552453*^9, 3.92362433353424*^9}, 
   3.9245830320020237`*^9, 3.926393335312231*^9, 3.9269979024819307`*^9, 
   3.927083884790679*^9, 3.92708559794291*^9, 3.9270868982024813`*^9},
 CellLabel->
  "Out[351]=",ExpressionUUID->"4530c0fd-e875-4371-adcd-d983e8165907"],

Cell[BoxData[
 RowBox[{
  FractionBox["1", "2"], " ", 
  RowBox[{"(", 
   RowBox[{"1", "+", 
    FractionBox[
     RowBox[{"c", " ", 
      RowBox[{"(", 
       RowBox[{"1", "+", "\[Gamma]"}], ")"}]}], 
     RowBox[{
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], " ", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "2"}], "+", "c", "+", 
        RowBox[{"2", " ", "d"}], "-", 
        RowBox[{"4", " ", "\[Theta]"}]}], ")"}]}]]}], ")"}]}]], "Output",
 CellChangeTimes->{
  3.8853595634267073`*^9, 3.8853596110443425`*^9, 3.885377478968847*^9, 
   3.8858866532536387`*^9, 3.8866567914209375`*^9, 3.8877709830828943`*^9, 
   3.8879418658921323`*^9, 3.8881451014894104`*^9, 3.8883037403971148`*^9, 
   3.891661224568159*^9, 3.9224990653624754`*^9, 3.923568135643761*^9, 
   3.9235681737217474`*^9, {3.923624303552453*^9, 3.92362433353424*^9}, 
   3.9245830320020237`*^9, 3.926393335312231*^9, 3.9269979024819307`*^9, 
   3.927083884790679*^9, 3.92708559794291*^9, 3.927086898206465*^9},
 CellLabel->
  "Out[352]=",ExpressionUUID->"a0c7133d-a719-45e4-bfdc-6525906217e1"],

Cell[BoxData["0"], "Output",
 CellChangeTimes->{
  3.8853595634267073`*^9, 3.8853596110443425`*^9, 3.885377478968847*^9, 
   3.8858866532536387`*^9, 3.8866567914209375`*^9, 3.8877709830828943`*^9, 
   3.8879418658921323`*^9, 3.8881451014894104`*^9, 3.8883037403971148`*^9, 
   3.891661224568159*^9, 3.9224990653624754`*^9, 3.923568135643761*^9, 
   3.9235681737217474`*^9, {3.923624303552453*^9, 3.92362433353424*^9}, 
   3.9245830320020237`*^9, 3.926393335312231*^9, 3.9269979024819307`*^9, 
   3.927083884790679*^9, 3.92708559794291*^9, 3.927086898209462*^9},
 CellLabel->
  "Out[353]=",ExpressionUUID->"142e58a8-ed1c-4cbd-aa08-ed5d63fd890f"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"The", " ", "consumer", " ", 
    RowBox[{"surplus", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{"u", " ", "-", "PMS", "-", 
      RowBox[{"c", " ", "q2"}]}], "/.", 
     RowBox[{"q2", "\[Rule]", 
      RowBox[{
       RowBox[{
        RowBox[{"(", 
         RowBox[{"1", "-", "s"}], ")"}], "/", "s"}], " ", "q1"}]}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"FullSimplify", "[", 
    RowBox[{"Solve", "[", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{
        RowBox[{
         RowBox[{"D", "[", 
          RowBox[{"%", ",", "q1"}], "]"}], "\[Equal]", "0"}], ",", 
        RowBox[{
         RowBox[{"D", "[", 
          RowBox[{"%", ",", "s"}], "]"}], "\[Equal]", "0"}]}], "}"}], ",", 
      RowBox[{"{", 
       RowBox[{"q1", ",", "s"}], "}"}]}], "]"}], "]"}], "\[IndentingNewLine]", 
   RowBox[{"UMS", "=", 
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{"%%", "-", "Ksol"}], "/.", 
      RowBox[{"%", "[", 
       RowBox[{"[", "1", "]"}], "]"}]}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.885378324127864*^9, 3.885378347698471*^9}, {
   3.8853789505952525`*^9, 3.885378952551469*^9}, {3.885378999862666*^9, 
   3.885379006777933*^9}, 3.885379100061313*^9, {3.9235681869857626`*^9, 
   3.92356819319958*^9}},
 CellLabel->
  "In[354]:=",ExpressionUUID->"556db6a0-448c-4b10-8d04-e5bb8a40e9ff"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"q1", "\[Rule]", 
      FractionBox[
       RowBox[{
        RowBox[{"-", "1"}], "+", "d", "+", "\[Gamma]", "-", 
        RowBox[{"c", " ", "\[Gamma]"}], "-", 
        RowBox[{"d", " ", "\[Gamma]"}], "+", 
        RowBox[{"2", " ", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], " ", "\[Theta]"}]}], 
       RowBox[{
        RowBox[{"-", "1"}], "+", 
        SuperscriptBox["\[Gamma]", "2"]}]]}], ",", 
     RowBox[{"s", "\[Rule]", 
      RowBox[{
       FractionBox["1", "2"], " ", 
       RowBox[{"(", 
        RowBox[{"1", "+", 
         FractionBox[
          RowBox[{"c", " ", 
           RowBox[{"(", 
            RowBox[{"1", "+", "\[Gamma]"}], ")"}]}], 
          RowBox[{
           RowBox[{"(", 
            RowBox[{
             RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], " ", 
           RowBox[{"(", 
            RowBox[{
             RowBox[{"-", "2"}], "+", "c", "+", 
             RowBox[{"2", " ", "d"}], "-", 
             RowBox[{"4", " ", "\[Theta]"}]}], ")"}]}]]}], ")"}]}]}]}], "}"}],
    ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"q1", "\[Rule]", "0"}], ",", 
     RowBox[{"s", "\[Rule]", 
      FractionBox[
       RowBox[{
        RowBox[{"c", " ", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", "1"}], "+", 
           RowBox[{"2", " ", "\[Gamma]"}]}], ")"}]}], "+", 
        RowBox[{
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], " ", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", "1"}], "+", "d", "-", 
           RowBox[{"2", " ", "\[Theta]"}]}], ")"}]}]}], 
       RowBox[{"c", " ", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{"-", "1"}], "+", 
          RowBox[{"3", " ", "\[Gamma]"}]}], ")"}]}]]}]}], "}"}]}], 
  "}"}]], "Output",
 CellChangeTimes->{{3.885378333047167*^9, 3.885378348362067*^9}, 
   3.8853789546028905`*^9, {3.8853790005106926`*^9, 3.8853790076954546`*^9}, 
   3.8853791008165164`*^9, 3.8858866793819666`*^9, 3.886565320124761*^9, 
   3.8866567916855836`*^9, 3.8877709834972973`*^9, 3.8879418660973682`*^9, 
   3.888145101666584*^9, 3.8883037405513663`*^9, 3.891661224627008*^9, 
   3.922499065415889*^9, 3.923568193869996*^9, 3.923624338691742*^9, 
   3.924583032042824*^9, 3.9263933398836794`*^9, 3.92699790252479*^9, 
   3.9270838849232364`*^9, 3.9270855980779734`*^9, 3.927086900776515*^9},
 CellLabel->
  "Out[355]=",ExpressionUUID->"478f9780-7e77-44c8-b7f3-d8fd93453337"],

Cell[BoxData[
 FractionBox[
  RowBox[{
   RowBox[{
    SuperscriptBox["d", "2"], " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "7"}], "+", "\[Gamma]"}], ")"}]}], "+", "\[Gamma]", "+", 
   RowBox[{
    SuperscriptBox["c", "2"], " ", 
    RowBox[{"(", 
     RowBox[{"1", "+", "\[Gamma]"}], ")"}]}], "+", 
   RowBox[{"2", " ", "c", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", 
      RowBox[{
       RowBox[{"(", 
        RowBox[{
         RowBox[{"-", "1"}], "+", "d"}], ")"}], " ", "\[Gamma]"}], "-", 
      "\[Theta]"}], ")"}]}], "+", 
   SuperscriptBox[
    RowBox[{"(", 
     RowBox[{"1", "+", 
      RowBox[{"2", " ", "\[Theta]"}]}], ")"}], "2"], "-", 
   RowBox[{"2", " ", "d", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "\[Gamma]", "+", 
      RowBox[{"2", " ", "\[Theta]"}]}], ")"}]}]}], 
  RowBox[{"2", " ", 
   RowBox[{"(", 
    RowBox[{"1", "+", "\[Gamma]"}], ")"}]}]]], "Output",
 CellChangeTimes->{{3.885378333047167*^9, 3.885378348362067*^9}, 
   3.8853789546028905`*^9, {3.8853790005106926`*^9, 3.8853790076954546`*^9}, 
   3.8853791008165164`*^9, 3.8858866793819666`*^9, 3.886565320124761*^9, 
   3.8866567916855836`*^9, 3.8877709834972973`*^9, 3.8879418660973682`*^9, 
   3.888145101666584*^9, 3.8883037405513663`*^9, 3.891661224627008*^9, 
   3.922499065415889*^9, 3.923568193869996*^9, 3.923624338691742*^9, 
   3.924583032042824*^9, 3.9263933398836794`*^9, 3.92699790252479*^9, 
   3.9270838849232364`*^9, 3.9270855980779734`*^9, 3.927086900892135*^9},
 CellLabel->
  "Out[356]=",ExpressionUUID->"9c8b0b67-85bc-4d95-825f-eb540721bcd3"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"A", " ", "check"}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{"FullSimplify", "[", 
   RowBox[{
    RowBox[{"UMS", "-", "VR"}], "/.", 
    RowBox[{"\[Theta]", "\[Rule]", 
     RowBox[{"1", "-", "d"}]}]}], "]"}]}]], "Input",
 CellChangeTimes->{{3.8853783516518526`*^9, 3.8853783636637945`*^9}, {
  3.9235681999474087`*^9, 3.923568203008127*^9}},
 CellLabel->
  "In[357]:=",ExpressionUUID->"0b34ee22-dc78-417d-9e63-faa883413020"],

Cell[BoxData[
 FractionBox[
  RowBox[{"5", "+", 
   RowBox[{"2", " ", "d", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "5"}], "+", "\[Gamma]"}], ")"}]}], "+", 
   RowBox[{
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "3"}], "+", 
      RowBox[{"2", " ", "c"}]}], ")"}], " ", "\[Gamma]"}]}], 
  RowBox[{"2", " ", 
   RowBox[{"(", 
    RowBox[{"1", "+", "\[Gamma]"}], ")"}]}]]], "Output",
 CellChangeTimes->{3.891661224757893*^9, 3.922499065447118*^9, 
  3.923568203440831*^9, 3.9236243514377356`*^9, 3.9245830320551434`*^9, 
  3.9269979025576787`*^9, 3.927083885004966*^9, 3.9270855981288085`*^9, 
  3.9270869035208454`*^9},
 CellLabel->
  "Out[357]=",ExpressionUUID->"6f095d16-e521-4f33-ac19-61d752ac17ef"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
   "Now", " ", "we", " ", "consider", " ", "the", " ", "exclusive", " ", 
    "dealing", " ", "contract", " ", "that", " ", "must", " ", "implement", 
    " ", "the", " ", 
    RowBox[{"buyer", "'"}], "s", " ", "payoff", " ", "type", " ", "by", " ", 
    RowBox[{"type", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{"URBtype", "=", 
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{
       RowBox[{"u", "-", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{"a1", " ", "q1"}], "+", 
          RowBox[{"a2", " ", 
           RowBox[{"q1", "^", "2"}]}], "+", 
          RowBox[{"b1", " ", "q2"}], "+", 
          RowBox[{"b2", " ", 
           RowBox[{"q2", "^", "2"}]}]}], ")"}], "-", "Ksol"}], "/.", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"q1", "\[Rule]", "q1sol"}], ",", 
         RowBox[{"q2", "\[Rule]", "q2sol"}]}], "}"}]}], "/.", "contr"}], 
     "]"}]}], "\[IndentingNewLine]", 
   RowBox[{"QRB", "=", 
    RowBox[{"FullSimplify", "[", 
     RowBox[{"D", "[", 
      RowBox[{"%", ",", "\[Theta]"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.888304878444995*^9, 3.8883048826318865`*^9}, {
   3.888304921521161*^9, 3.88830502003121*^9}, {3.8883050500973263`*^9, 
   3.8883050523453703`*^9}, {3.8883051508799677`*^9, 
   3.8883051526959977`*^9}, {3.888305277901783*^9, 3.888305280804806*^9}, {
   3.9235693593574123`*^9, 3.923569384386905*^9}, 3.9236243613676786`*^9},
 CellLabel->
  "In[358]:=",ExpressionUUID->"c4f44924-73a0-4cdc-868c-73a89f7d6f52"],

Cell[BoxData[
 FractionBox[
  RowBox[{
   RowBox[{
    SuperscriptBox["d", "2"], " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "7"}], "+", "\[Gamma]"}], ")"}]}], "+", "\[Gamma]", "+", 
   RowBox[{
    SuperscriptBox["c", "2"], " ", 
    RowBox[{"(", 
     RowBox[{"1", "+", "\[Gamma]"}], ")"}]}], "+", 
   RowBox[{"2", " ", "c", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", 
      RowBox[{
       RowBox[{"(", 
        RowBox[{
         RowBox[{"-", "1"}], "+", "d"}], ")"}], " ", "\[Gamma]"}], "-", 
      "\[Theta]"}], ")"}]}], "+", 
   SuperscriptBox[
    RowBox[{"(", 
     RowBox[{"1", "+", 
      RowBox[{"2", " ", "\[Theta]"}]}], ")"}], "2"], "-", 
   RowBox[{"2", " ", "d", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "\[Gamma]", "+", 
      RowBox[{"2", " ", "\[Theta]"}]}], ")"}]}]}], 
  RowBox[{"2", " ", 
   RowBox[{"(", 
    RowBox[{"1", "+", "\[Gamma]"}], ")"}]}]]], "Output",
 CellChangeTimes->{{3.8883049488216467`*^9, 3.888305020921523*^9}, 
   3.8883051573675127`*^9, 3.8883052816926947`*^9, 3.8916612248177004`*^9, 
   3.9224990654783764`*^9, 3.923569385374142*^9, 3.923624381630847*^9, 
   3.9245830320551434`*^9, 3.926393349252511*^9, 3.926997902588086*^9, 
   3.927083885071746*^9, 3.927085598186616*^9, 3.9270869073818655`*^9},
 CellLabel->
  "Out[358]=",ExpressionUUID->"d5fd97fe-3524-467c-9331-fe4b1f07959a"],

Cell[BoxData[
 FractionBox[
  RowBox[{"2", "-", "c", "-", 
   RowBox[{"2", " ", "d"}], "+", 
   RowBox[{"4", " ", "\[Theta]"}]}], 
  RowBox[{"1", "+", "\[Gamma]"}]]], "Output",
 CellChangeTimes->{{3.8883049488216467`*^9, 3.888305020921523*^9}, 
   3.8883051573675127`*^9, 3.8883052816926947`*^9, 3.8916612248177004`*^9, 
   3.9224990654783764`*^9, 3.923569385374142*^9, 3.923624381630847*^9, 
   3.9245830320551434`*^9, 3.926393349252511*^9, 3.926997902588086*^9, 
   3.927083885071746*^9, 3.927085598186616*^9, 3.9270869074247227`*^9},
 CellLabel->
  "Out[359]=",ExpressionUUID->"7cdacdd1-c9e9-4f23-b8a7-31d80b7aec37"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"Implemetation", " ", "of", " ", "the", " ", "latent", " ", 
    RowBox[{"contract", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{"QRB", "-", "q1Eind"}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", "0"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"QRB", "-", "q1Eind", "-", 
      RowBox[{"(", "%", ")"}]}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", "1"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{
      RowBox[{"%", "\[Equal]", "0"}], ",", 
      RowBox[{"%%", "\[Equal]", "0"}]}], "}"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"contrEimplRB", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{"%", ",", 
        RowBox[{"{", 
         RowBox[{"a1", ",", "a2"}], "}"}]}], "]"}], "]"}], "[", 
     RowBox[{"[", "1", "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.88830520736215*^9, 3.8883052579543023`*^9}, {
  3.8883053334435463`*^9, 3.888305340647673*^9}, {3.923569409079805*^9, 
  3.9235694147608395`*^9}, {3.9270852865378556`*^9, 3.9270852867303567`*^9}},
 CellLabel->
  "In[360]:=",ExpressionUUID->"6179b91c-cef3-40bd-ae90-e8e6bdaba7e9"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"a1", "\[Rule]", 
    RowBox[{
     FractionBox["1", "4"], " ", 
     RowBox[{"(", 
      RowBox[{"2", "+", "c", "+", 
       RowBox[{"2", " ", "d"}]}], ")"}]}]}], ",", 
   RowBox[{"a2", "\[Rule]", 
    RowBox[{
     FractionBox["1", "8"], " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "3"}], "+", "\[Gamma]"}], ")"}]}]}]}], "}"}]], "Output",
 CellChangeTimes->{{3.888305225166936*^9, 3.8883052581338797`*^9}, 
   3.891661224942092*^9, 3.922499065547558*^9, 3.923569415863961*^9, 
   3.923624403701948*^9, 3.9245830320733585`*^9, 3.9263933514665103`*^9, 
   3.9269979026229763`*^9, 3.927083885141508*^9, 3.9270852906839137`*^9, 
   3.927085598258073*^9, 3.927086909791016*^9},
 CellLabel->
  "Out[363]=",ExpressionUUID->"c1fc84a1-bb74-42b0-aab6-03a5eb082807"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"Defining", " ", "the", " ", "associated", " ", 
    RowBox[{"buyer", "'"}], "s", " ", 
    RowBox[{"payoff", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"u", "-", "F1", "-", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"a1", " ", "q1"}], "+", 
         RowBox[{"a2", " ", 
          RowBox[{"q1", "^", "2"}]}]}], ")"}]}], "/.", 
      RowBox[{"q2", "\[Rule]", "0"}]}], "/.", "contrEimplRB"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{
         RowBox[{"D", "[", 
          RowBox[{"%", ",", "q1"}], "]"}], "\[Equal]", "0"}], ",", "q1"}], 
       "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"UEimplRB", "=", 
    RowBox[{"FullSimplify", "[", 
     RowBox[{"%%", "/.", 
      RowBox[{"q1", "\[Rule]", "%"}]}], "]"}]}], 
   "\[IndentingNewLine]"}]}]], "Input",
 CellChangeTimes->{{3.888305361766614*^9, 3.8883054403402147`*^9}, {
  3.888305654816272*^9, 3.888305655160676*^9}, {3.9235694280721908`*^9, 
  3.923569448687235*^9}},
 CellLabel->
  "In[364]:=",ExpressionUUID->"235042be-ce0d-46b5-ae3c-952cb485de47"],

Cell[BoxData[
 FractionBox[
  RowBox[{"4", "+", 
   SuperscriptBox["c", "2"], "-", 
   RowBox[{"8", " ", "d"}], "-", 
   RowBox[{"8", " ", "F1", " ", 
    RowBox[{"(", 
     RowBox[{"1", "+", "\[Gamma]"}], ")"}]}], "+", 
   RowBox[{"4", " ", "c", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "d", "-", 
      RowBox[{"2", " ", "\[Theta]"}]}], ")"}]}], "+", 
   RowBox[{"4", " ", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{"d", "-", 
       RowBox[{"2", " ", "\[Theta]"}]}], ")"}], "2"]}], "+", 
   RowBox[{"16", " ", "\[Theta]"}]}], 
  RowBox[{"8", " ", 
   RowBox[{"(", 
    RowBox[{"1", "+", "\[Gamma]"}], ")"}]}]]], "Output",
 CellChangeTimes->{{3.888305396620145*^9, 3.8883054409902787`*^9}, 
   3.8883056562823772`*^9, 3.891661224955165*^9, 3.922499065585334*^9, 
   3.923569449805271*^9, 3.923624426260559*^9, 3.924583032135949*^9, 
   3.926393355299114*^9, 3.9269979027196484`*^9, 3.9270838852631016`*^9, 
   3.927085598484319*^9, 3.9270869125882325`*^9},
 CellLabel->
  "Out[366]=",ExpressionUUID->"09da455d-6310-421f-be7c-0e522227053b"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
   "And", " ", "we", " ", "can", " ", "now", " ", "determine", " ", "the", 
    " ", "fixed", " ", "fee", " ", "of", " ", "the", " ", "latent", " ", 
    RowBox[{"contract", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{"Collect", "[", 
    RowBox[{"UEimplRB", ",", "\[Theta]", ",", "FullSimplify"}], "]"}], 
   "\[IndentingNewLine]", 
   RowBox[{"Collect", "[", 
    RowBox[{"URBtype", ",", "\[Theta]", ",", "FullSimplify"}], "]"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{"%", "-", "%%"}], "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"fixedEimplRB", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{"%", "\[Equal]", "0"}], ",", "F1"}], "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.8883055996887226`*^9, 3.8883056855042324`*^9}, {
  3.923569537691382*^9, 3.9235695533935995`*^9}},
 CellLabel->
  "In[367]:=",ExpressionUUID->"0d2ecbb7-bd50-4a3b-bfed-2d56009a0e55"],

Cell[BoxData[
 RowBox[{
  FractionBox[
   RowBox[{"4", "+", 
    SuperscriptBox["c", "2"], "+", 
    RowBox[{"4", " ", "c", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "d"}], ")"}]}], "+", 
    RowBox[{"4", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "2"}], "+", "d"}], ")"}], " ", "d"}], "-", 
    RowBox[{"8", " ", "F1", " ", 
     RowBox[{"(", 
      RowBox[{"1", "+", "\[Gamma]"}], ")"}]}]}], 
   RowBox[{"8", " ", 
    RowBox[{"(", 
     RowBox[{"1", "+", "\[Gamma]"}], ")"}]}]], "-", 
  FractionBox[
   RowBox[{
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "2"}], "+", "c", "+", 
      RowBox[{"2", " ", "d"}]}], ")"}], " ", "\[Theta]"}], 
   RowBox[{"1", "+", "\[Gamma]"}]], "+", 
  FractionBox[
   RowBox[{"2", " ", 
    SuperscriptBox["\[Theta]", "2"]}], 
   RowBox[{"1", "+", "\[Gamma]"}]]}]], "Output",
 CellChangeTimes->{
  3.8883056000274925`*^9, {3.888305644973446*^9, 3.888305686005774*^9}, 
   3.8916612251065235`*^9, 3.9224990656790915`*^9, 3.923569555486286*^9, 
   3.923624439695073*^9, 3.9245830321671247`*^9, 3.926393362100032*^9, 
   3.926997902766489*^9, 3.927083885341257*^9, 3.927085598561058*^9, 
   3.9270869174010363`*^9},
 CellLabel->
  "Out[367]=",ExpressionUUID->"5c69249b-bb52-49fd-ae84-1ddb8682e8d1"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   FractionBox["1", "2"], " ", 
   SuperscriptBox[
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "c", "+", "d"}], ")"}], "2"]}], "-", 
  FractionBox[
   RowBox[{"d", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "2"}], "+", "c", "+", 
      RowBox[{"4", " ", "d"}]}], ")"}]}], 
   RowBox[{"1", "+", "\[Gamma]"}]], "-", 
  FractionBox[
   RowBox[{
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "2"}], "+", "c", "+", 
      RowBox[{"2", " ", "d"}]}], ")"}], " ", "\[Theta]"}], 
   RowBox[{"1", "+", "\[Gamma]"}]], "+", 
  FractionBox[
   RowBox[{"2", " ", 
    SuperscriptBox["\[Theta]", "2"]}], 
   RowBox[{"1", "+", "\[Gamma]"}]]}]], "Output",
 CellChangeTimes->{
  3.8883056000274925`*^9, {3.888305644973446*^9, 3.888305686005774*^9}, 
   3.8916612251065235`*^9, 3.9224990656790915`*^9, 3.923569555486286*^9, 
   3.923624439695073*^9, 3.9245830321671247`*^9, 3.926393362100032*^9, 
   3.926997902766489*^9, 3.927083885341257*^9, 3.927085598561058*^9, 
   3.9270869175496445`*^9},
 CellLabel->
  "Out[368]=",ExpressionUUID->"30d71dc7-befb-4575-b61f-1e6add6de3fe"],

Cell[BoxData[
 FractionBox[
  RowBox[{
   RowBox[{"4", " ", "c"}], "-", 
   RowBox[{"3", " ", 
    SuperscriptBox["c", "2"]}], "-", 
   RowBox[{"16", " ", "d"}], "+", 
   RowBox[{"4", " ", "c", " ", "d"}], "+", 
   RowBox[{"32", " ", 
    SuperscriptBox["d", "2"]}], "-", 
   RowBox[{"4", " ", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "c", "+", "d"}], ")"}], "2"], " ", 
    "\[Gamma]"}]}], 
  RowBox[{"8", " ", 
   RowBox[{"(", 
    RowBox[{"1", "+", "\[Gamma]"}], ")"}]}]]], "Output",
 CellChangeTimes->{
  3.8883056000274925`*^9, {3.888305644973446*^9, 3.888305686005774*^9}, 
   3.8916612251065235`*^9, 3.9224990656790915`*^9, 3.923569555486286*^9, 
   3.923624439695073*^9, 3.9245830321671247`*^9, 3.926393362100032*^9, 
   3.926997902766489*^9, 3.927083885341257*^9, 3.927085598561058*^9, 
   3.9270869177525115`*^9},
 CellLabel->
  "Out[370]=",ExpressionUUID->"6e1d56e8-91f5-4ee9-a8fc-8f44b7a068c3"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"A", " ", "check"}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{"FullSimplify", "[", 
   RowBox[{
    RowBox[{"URBtype", "-", "UEimplRB"}], " ", "/.", 
    RowBox[{"F1", "->", "fixedEimplRB"}]}], "]"}]}]], "Input",
 CellChangeTimes->{{3.8883054554676256`*^9, 3.888305460457664*^9}, {
  3.888305749871995*^9, 3.888305760609322*^9}, {3.9235695755189323`*^9, 
  3.923569579396118*^9}},
 CellLabel->
  "In[371]:=",ExpressionUUID->"866ee4ba-3862-464c-8434-f4415e97cb06"],

Cell[BoxData["0"], "Output",
 CellChangeTimes->{3.8883054610603886`*^9, 3.8883057610340652`*^9, 
  3.891661225305002*^9, 3.9224990657793875`*^9, 3.9235695799291573`*^9, 
  3.9245830322739267`*^9, 3.9263933653035064`*^9, 3.9269979029869165`*^9, 
  3.927083885761302*^9, 3.9270855992361364`*^9, 3.9270869201194973`*^9},
 CellLabel->
  "Out[371]=",ExpressionUUID->"eef180ee-b007-44c0-9d7d-1385b91e2fa3"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
     RowBox[{
     "Now", " ", "the", " ", "study", " ", "the", " ", "constrained", " ", 
      "case", " ", 
      RowBox[{
       RowBox[{"(", 
        RowBox[{
         RowBox[{"i", ".", "e", ".", " ", "the"}], " ", "participation", " ", 
         "constraint", " ", "binds", " ", "for", " ", "a", " ", "set", " ", 
         "of", " ", "low", " ", "types"}], ")"}], ".", "\[IndentingNewLine]", 
       "Where"}], " ", "it", " ", "is", " ", "binding", " ", "one", " ", 
      "must", " ", "replicate", " ", "type"}], "-", "by", "-", 
     RowBox[{
     "type", " ", "the", " ", "reservation", " ", "payoff", " ", "and", " ", 
      "this", " ", "is", " ", "obtained", " ", "with", " ", "q1"}], "+", 
     "q2"}], "=", 
    RowBox[{"qe2", "."}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{"u", "-", 
      RowBox[{"c", " ", "q2"}], "-", 
      RowBox[{
       RowBox[{
        RowBox[{"(", 
         RowBox[{"1", "-", "F"}], ")"}], "/", "f"}], " ", 
       RowBox[{"D", "[", 
        RowBox[{"u", ",", "\[Theta]"}], "]"}]}]}], "/.", 
     RowBox[{"q2", "\[Rule]", 
      RowBox[{"qe2", "-", "q1"}]}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{"D", "[", 
      RowBox[{"%", ",", "q1"}], "]"}], "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"q1bind", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{"%", "\[Equal]", "0"}], ",", "q1"}], "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}], 
   "\[IndentingNewLine]", 
   RowBox[{"q2bind", "=", 
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{"qe2", "-", "q1"}], "/.", 
      RowBox[{"q1", "\[Rule]", "q1bind"}]}], "]"}]}], "\[IndentingNewLine]", 
   RowBox[{"FullSimplify", "[", 
    RowBox[{"q1bind", "+", "q2bind"}], "]"}]}]}]], "Input",
 CellChangeTimes->{{3.9235685699396243`*^9, 3.9235685848515882`*^9}, {
   3.9235695918972063`*^9, 3.9235695936175766`*^9}, {3.9236250678126965`*^9, 
   3.9236251357225065`*^9}, 3.9236251717768297`*^9},
 CellLabel->"In[88]:=",ExpressionUUID->"8f5736cc-45bd-4d29-8b08-a945e7d88ed5"],

Cell[BoxData[
 FractionBox[
  RowBox[{"1", "+", 
   RowBox[{"\[Gamma]", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "c", "-", "\[Theta]"}], ")"}]}], "+", 
   "\[Theta]"}], 
  RowBox[{"2", "-", 
   RowBox[{"2", " ", "\[Gamma]"}]}]]], "Output",
 CellChangeTimes->{3.9235685926887274`*^9, 3.9236250842561674`*^9, 
  3.92362513667188*^9, 3.9236251723484993`*^9, 3.9245830322909565`*^9, 
  3.926393368335432*^9, 3.9269979030277843`*^9, 3.9270838858350554`*^9, 
  3.9270855993178673`*^9},
 CellLabel->"Out[90]=",ExpressionUUID->"bb1d83ea-14e3-4207-8e84-93d3cb7825f8"],

Cell[BoxData[
 RowBox[{
  FractionBox["1", "2"], " ", 
  RowBox[{"(", 
   RowBox[{"1", "+", 
    RowBox[{"c", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", 
       FractionBox["1", 
        RowBox[{
         RowBox[{"-", "1"}], "+", "\[Gamma]"}]]}], ")"}]}], "+", "\[Theta]"}],
    ")"}]}]], "Output",
 CellChangeTimes->{3.9235685926887274`*^9, 3.9236250842561674`*^9, 
  3.92362513667188*^9, 3.9236251723484993`*^9, 3.9245830322909565`*^9, 
  3.926393368335432*^9, 3.9269979030277843`*^9, 3.9270838858350554`*^9, 
  3.9270855993767385`*^9},
 CellLabel->"Out[91]=",ExpressionUUID->"3a698300-36d7-4e39-816d-e3806f489449"],

Cell[BoxData[
 RowBox[{"1", "-", "c", "+", "\[Theta]"}]], "Output",
 CellChangeTimes->{3.9235685926887274`*^9, 3.9236250842561674`*^9, 
  3.92362513667188*^9, 3.9236251723484993`*^9, 3.9245830322909565`*^9, 
  3.926393368335432*^9, 3.9269979030277843`*^9, 3.9270838858350554`*^9, 
  3.9270855993796577`*^9},
 CellLabel->"Out[92]=",ExpressionUUID->"ef413989-a468-44c7-9a7a-77ae9d4b34b7"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"And", " ", "the", " ", "implementation"}], "*)"}], 
  "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{"q1ind", "-", "q1bind"}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", "0"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"q1ind", "-", "q1bind", "-", 
      RowBox[{"(", "%", ")"}]}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", "1"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"q2ind", "-", "q2bind"}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", "0"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"q2ind", "-", "q2bind", "-", 
      RowBox[{"(", "%", ")"}]}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", "1"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{
      RowBox[{"%", "\[Equal]", "0"}], ",", 
      RowBox[{"%%", "\[Equal]", "0"}], ",", 
      RowBox[{"%%%", "\[Equal]", "0"}], ",", 
      RowBox[{"%%%%", "\[Equal]", "0"}]}], "}"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"contrbind", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{"%", ",", 
        RowBox[{"{", 
         RowBox[{"a1", ",", "a2", ",", "b1", ",", "b2"}], "}"}]}], "]"}], 
      "]"}], "[", 
     RowBox[{"[", "1", "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.8859193661992702`*^9, 3.8859193774283733`*^9}, {
  3.923568607022258*^9, 3.9235686124248543`*^9}, {3.923569307157436*^9, 
  3.923569308953216*^9}},
 CellLabel->"In[93]:=",ExpressionUUID->"78c987ca-34a9-470c-bfb0-3ba085f7d9b8"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"a1", "\[Rule]", "0"}], ",", 
   RowBox[{"a2", "\[Rule]", 
    FractionBox[
     RowBox[{"1", "-", "\[Gamma]"}], "2"]}], ",", 
   RowBox[{"b1", "\[Rule]", 
    RowBox[{"2", " ", "c"}]}], ",", 
   RowBox[{"b2", "\[Rule]", 
    FractionBox[
     RowBox[{"1", "-", "\[Gamma]"}], "2"]}]}], "}"}]], "Output",
 CellChangeTimes->{3.923625142367645*^9, 3.923625224627903*^9, 
  3.92458303233789*^9, 3.926393371809552*^9, 3.926997903090988*^9, 
  3.9270838859556527`*^9, 3.9270855994404583`*^9},
 CellLabel->"Out[98]=",ExpressionUUID->"d7b607e1-a63d-4010-bc05-641753137c26"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"With", " ", "the", " ", "switching", " ", 
    RowBox[{"type", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{"FullSimplify", "[", 
    RowBox[{"q1sol", "+", "q2sol"}], "]"}], "\[IndentingNewLine]", 
   RowBox[{"\[Theta]switch", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{"qe2", "\[Equal]", "%"}], ",", "\[Theta]"}], "]"}], "]"}], 
     "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.885527074733515*^9, 3.885527110006935*^9}, {
  3.885623894384373*^9, 3.8856239005489516`*^9}, {3.9235686237691708`*^9, 
  3.9235686379382467`*^9}},
 CellLabel->"In[99]:=",ExpressionUUID->"76a4bf5b-0f82-43e9-8133-18f08a845783"],

Cell[BoxData[
 FractionBox[
  RowBox[{"2", "-", "c", "-", 
   RowBox[{"2", " ", "d"}], "+", 
   RowBox[{"4", " ", "\[Theta]"}]}], 
  RowBox[{"1", "+", "\[Gamma]"}]]], "Output",
 CellChangeTimes->{{3.8855270992370977`*^9, 3.885527111188445*^9}, 
   3.885623901797781*^9, 3.885886873095644*^9, 3.886565729108529*^9, 
   3.8866567925991707`*^9, 3.887770984967699*^9, 3.887941866678056*^9, 
   3.888145103023467*^9, 3.8883037416236877`*^9, 3.891661225752937*^9, 
   3.9224990660336657`*^9, 3.923568693780997*^9, 3.92362524192636*^9, 
   3.92458303233789*^9, 3.926393376385688*^9, 3.9269979031188917`*^9, 
   3.92708388601645*^9, 3.927085599497264*^9},
 CellLabel->"Out[99]=",ExpressionUUID->"f15a205d-958c-44f8-9574-922eaad5c35f"],

Cell[BoxData[
 FractionBox[
  RowBox[{"1", "-", 
   RowBox[{"2", " ", "d"}], "+", 
   RowBox[{
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "c"}], ")"}], " ", "\[Gamma]"}]}], 
  RowBox[{
   RowBox[{"-", "3"}], "+", "\[Gamma]"}]]], "Output",
 CellChangeTimes->{{3.8855270992370977`*^9, 3.885527111188445*^9}, 
   3.885623901797781*^9, 3.885886873095644*^9, 3.886565729108529*^9, 
   3.8866567925991707`*^9, 3.887770984967699*^9, 3.887941866678056*^9, 
   3.888145103023467*^9, 3.8883037416236877`*^9, 3.891661225752937*^9, 
   3.9224990660336657`*^9, 3.923568693780997*^9, 3.92362524192636*^9, 
   3.92458303233789*^9, 3.926393376385688*^9, 3.9269979031188917`*^9, 
   3.92708388601645*^9, 3.9270855995012493`*^9},
 CellLabel->
  "Out[100]=",ExpressionUUID->"26a0299b-a5a3-418f-bbcb-1d44135744e8"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"FullSimplify", "[", 
   RowBox[{"Solve", "[", 
    RowBox[{
     RowBox[{"\[Theta]switch", "\[Equal]", 
      RowBox[{"-", "d"}]}], ",", "d"}], "]"}], "]"}], "\[IndentingNewLine]", 
  RowBox[{"(*", 
   RowBox[{"which", ",", " ", 
    RowBox[{"as", " ", "expected"}], ",", "  ", 
    RowBox[{"is", " ", "as"}]}], " ", 
   "*)"}]}], "\[IndentingNewLine]", "Doutside"}], "Input",
 CellChangeTimes->{{3.8855271131515408`*^9, 3.88552714801595*^9}, {
   3.885527302779948*^9, 3.8855273063857555`*^9}, {3.8856241622707863`*^9, 
   3.885624162370914*^9}, {3.923568704389502*^9, 3.9235687186628437`*^9}, 
   3.926393378146182*^9},
 CellLabel->
  "In[101]:=",ExpressionUUID->"43218448-8c29-4af5-9904-3261c50158aa"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"{", 
   RowBox[{"d", "\[Rule]", 
    FractionBox[
     RowBox[{
      RowBox[{"-", "1"}], "+", "\[Gamma]", "-", 
      RowBox[{"c", " ", "\[Gamma]"}]}], 
     RowBox[{
      RowBox[{"-", "5"}], "+", "\[Gamma]"}]]}], "}"}], "}"}]], "Output",
 CellChangeTimes->{{3.885527129544321*^9, 3.885527148200842*^9}, 
   3.8855273074223623`*^9, 3.8856239093714623`*^9, 3.885624162733966*^9, 
   3.885886877053356*^9, 3.8865657360097313`*^9, 3.886656792722847*^9, 
   3.8877709851506653`*^9, 3.8879418667783594`*^9, 3.888145103204916*^9, 
   3.8883037417836714`*^9, 3.891661225804504*^9, 3.9224990660871487`*^9, 
   3.9235687193483934`*^9, 3.923625248150973*^9, 3.9245830323535414`*^9, 
   3.9263933787363386`*^9, 3.9269979031528716`*^9, 3.927083886071325*^9, 
   3.92708559955208*^9},
 CellLabel->
  "Out[101]=",ExpressionUUID->"9bf1333a-95f8-43d2-a67d-2c00f0d677b9"],

Cell[BoxData[
 FractionBox[
  RowBox[{
   RowBox[{"-", "1"}], "+", "\[Gamma]", "-", 
   RowBox[{"c", " ", "\[Gamma]"}]}], 
  RowBox[{
   RowBox[{"-", "5"}], "+", "\[Gamma]"}]]], "Output",
 CellChangeTimes->{{3.885527129544321*^9, 3.885527148200842*^9}, 
   3.8855273074223623`*^9, 3.8856239093714623`*^9, 3.885624162733966*^9, 
   3.885886877053356*^9, 3.8865657360097313`*^9, 3.886656792722847*^9, 
   3.8877709851506653`*^9, 3.8879418667783594`*^9, 3.888145103204916*^9, 
   3.8883037417836714`*^9, 3.891661225804504*^9, 3.9224990660871487`*^9, 
   3.9235687193483934`*^9, 3.923625248150973*^9, 3.9245830323535414`*^9, 
   3.9263933787363386`*^9, 3.9269979031528716`*^9, 3.927083886071325*^9, 
   3.927085599557063*^9},
 CellLabel->
  "Out[102]=",ExpressionUUID->"a29628bf-9b2f-4a39-bcb3-f793f5f1deec"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
   "Il", " ", "regime", " ", "in", " ", "cui", " ", "\[EGrave]", " ", "tutto",
     " ", "constrained", " ", "non", " ", "esiste", " ", "vedi", " ", 
    "sotto"}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"{", 
     RowBox[{"\[Theta]switch", ",", 
      RowBox[{"1", "+", "d"}]}], "}"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"Manipulate", "[", 
    RowBox[{
     RowBox[{"Plot", "[", 
      RowBox[{"%", ",", 
       RowBox[{"{", 
        RowBox[{"d", ",", "0", ",", "1"}], "}"}]}], "]"}], ",", 
     RowBox[{"{", 
      RowBox[{"c", ",", "0", ",", "1"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"\[Gamma]", ",", "0", ",", "1"}], "}"}]}], "]"}]}]}]], "Input",
 CellChangeTimes->{{3.8865670759106283`*^9, 3.8865671674372444`*^9}, {
  3.887943352291295*^9, 3.8879433700132933`*^9}, {3.8879442308098555`*^9, 
  3.887944236840841*^9}},
 CellLabel->
  "In[103]:=",ExpressionUUID->"fb6d73fd-44bd-4067-b43a-c5b882952456"],

Cell[BoxData[
 TagBox[
  StyleBox[
   DynamicModuleBox[{$CellContext`c$$ = 0, $CellContext`\[Gamma]$$ = 0, 
    Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, 
    Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 
    1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{
      Hold[$CellContext`c$$], 0, 1}, {
      Hold[$CellContext`\[Gamma]$$], 0, 1}}, Typeset`size$$ = {
    360., {106., 110.99657259881528`}}, Typeset`update$$ = 0, 
    Typeset`initDone$$, Typeset`skipInitDone$$ = True}, 
    DynamicBox[Manipulate`ManipulateBoxes[
     1, StandardForm, 
      "Variables" :> {$CellContext`c$$ = 0, $CellContext`\[Gamma]$$ = 0}, 
      "ControllerVariables" :> {}, 
      "OtherVariables" :> {
       Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, 
        Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, 
        Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$,
         Typeset`skipInitDone$$}, "Body" :> 
      Plot[{(-3 + $CellContext`\[Gamma]$$)^(-1) (1 - 
          2 $CellContext`d + (-1 + $CellContext`c$$) $CellContext`\[Gamma]$$),
          1 + $CellContext`d}, {$CellContext`d, 0, 1}], 
      "Specifications" :> {{$CellContext`c$$, 0, 1}, {$CellContext`\[Gamma]$$,
          0, 1}}, "Options" :> {}, "DefaultOptions" :> {}],
     ImageSizeCache->{817., {135., 141.}},
     SingleEvaluation->True],
    Deinitialization:>None,
    DynamicModuleValues:>{},
    SynchronousInitialization->True,
    UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$},
    UnsavedVariables:>{Typeset`initDone$$},
    UntrackedVariables:>{Typeset`size$$}], "Manipulate",
   Deployed->True,
   StripOnInput->False],
  Manipulate`InterpretManipulate[1]]], "Output",
 CellChangeTimes->{{3.8865671108826647`*^9, 3.886567141890438*^9}, 
   3.8866567930613184`*^9, 3.8877709856677885`*^9, 3.8879418671947703`*^9, 
   3.887943370597409*^9, 3.888145103416504*^9, 3.8883037419471636`*^9, 
   3.891661225857437*^9, 3.92249906611843*^9, 3.924583032374152*^9, 
   3.926997903193742*^9, 3.9270838861311245`*^9, 3.927085599639323*^9},
 CellLabel->
  "Out[104]=",ExpressionUUID->"7b49e12d-268d-4f45-bb80-939bdac1dc59"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
   "Now", " ", "we", " ", "show", " ", "that", " ", "the", " ", "third", " ", 
    "regime", " ", "where", " ", "in", " ", "principle", " ", "the", " ", 
    "participation", " ", "constraint", " ", "binds", " ", "for", " ", 
    "types", " ", "does", " ", "not", " ", 
    RowBox[{"exist", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"\[Theta]switch", "\[Equal]", "d"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"Allconstrained", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{"%", ",", "d"}], "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}], 
   "\[IndentingNewLine]", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"qe2", "-", 
       RowBox[{"(", 
        RowBox[{"q1ind", "+", "q2ind"}], ")"}]}], "/.", "contr"}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", "d"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"Reduce", "[", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"%", ">", "0"}], ",", 
      RowBox[{"1", ">", "\[Gamma]", ">", "0"}], ",", 
      RowBox[{"1", ">", "d", ">", "0"}], ",", 
      RowBox[{"1", ">", "c", ">", "0"}]}], "}"}], "]"}], 
   "\[IndentingNewLine]", "\[IndentingNewLine]", 
   RowBox[{"Allconstrained", ";"}], "\[IndentingNewLine]", 
   RowBox[{"Reduce", "[", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"%", ">", "0"}], ",", 
      RowBox[{"1", ">", "\[Gamma]", ">", "0"}], ",", 
      RowBox[{"1", ">", "c", ">", "0"}]}], "}"}], "]"}]}]}]], "Input",
 CellChangeTimes->{{3.9235687547516603`*^9, 3.923568827199978*^9}, {
  3.9263933908750525`*^9, 3.926393395298395*^9}},
 CellLabel->
  "In[105]:=",ExpressionUUID->"776d620b-edb2-49cc-8e8f-528d6f15a58b"],

Cell[BoxData[
 RowBox[{
  RowBox[{"-", "1"}], "+", 
  FractionBox[
   RowBox[{"c", " ", "\[Gamma]"}], 
   RowBox[{
    RowBox[{"-", "1"}], "+", "\[Gamma]"}]]}]], "Output",
 CellChangeTimes->{3.9235688275178075`*^9, 3.9236252921814165`*^9, 
  3.924583032389831*^9, 3.9263933963144026`*^9, 3.9269979032276287`*^9, 
  3.927083886244745*^9, 3.9270855996995497`*^9},
 CellLabel->
  "Out[106]=",ExpressionUUID->"3b02f679-c1d3-481f-85c0-1b1ca81f25c2"],

Cell[BoxData["False"], "Output",
 CellChangeTimes->{3.9235688275178075`*^9, 3.9236252921814165`*^9, 
  3.924583032389831*^9, 3.9263933963144026`*^9, 3.9269979032276287`*^9, 
  3.927083886244745*^9, 3.927085599709509*^9},
 CellLabel->
  "Out[108]=",ExpressionUUID->"a76427ce-e49e-42a2-8187-db44c44fde74"],

Cell[BoxData["False"], "Output",
 CellChangeTimes->{3.9235688275178075`*^9, 3.9236252921814165`*^9, 
  3.924583032389831*^9, 3.9263933963144026`*^9, 3.9269979032276287`*^9, 
  3.927083886244745*^9, 3.9270855997135*^9},
 CellLabel->
  "Out[110]=",ExpressionUUID->"6f3c719a-e0d7-4bf6-b439-4e1440f38c5a"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
   "Now", " ", "we", " ", "determine", " ", "the", " ", "fixed", " ", "fees", 
    " ", "with", " ", "the", " ", "partially", " ", "constrained", " ", 
    RowBox[{"regims", ".", " ", "Since"}], " ", "there", " ", "are", " ", 
    "two", " ", "groups", " ", "we", " ", "first", " ", "determined", " ", 
    "the", " ", "fixed", " ", "fee", " ", "for", " ", "the", " ", "lowest", 
    " ", 
    RowBox[{"types", "'"}], " ", 
    RowBox[{"contract", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"VR", "-", 
        RowBox[{"(", 
         RowBox[{"u", "-", 
          RowBox[{"(", 
           RowBox[{
            RowBox[{"a1", " ", "q1"}], "+", 
            RowBox[{"a2", " ", 
             RowBox[{"q1", "^", "2"}]}], "+", 
            RowBox[{"b1", " ", "q2"}], "+", 
            RowBox[{"b2", " ", 
             RowBox[{"q2", "^", "2"}]}]}], ")"}], "-", "k"}], ")"}]}], "/.", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"q1", "\[Rule]", "q1bind"}], ",", 
         RowBox[{"q2", "\[Rule]", "q2bind"}]}], "}"}]}], "/.", "contrbind"}], 
     "/.", 
     RowBox[{"\[Theta]", "\[Rule]", 
      RowBox[{"-", "d"}]}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"Kconstrbasso", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{"%", "\[Equal]", "0"}], ",", "k"}], "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.8865662110089045`*^9, 3.8865663167667108`*^9}, {
   3.923568833228897*^9, 3.923568869272832*^9}, 3.926393402867525*^9},
 CellLabel->
  "In[372]:=",ExpressionUUID->"0066fba3-85ae-4002-a646-144ce9d48e4d"],

Cell[BoxData[
 FractionBox[
  SuperscriptBox["c", "2"], 
  RowBox[{"2", "-", 
   RowBox[{"2", " ", "\[Gamma]"}]}]]], "Output",
 CellChangeTimes->{
  3.886566260751362*^9, {3.8865662954717474`*^9, 3.88656631719028*^9}, 
   3.8866567935674334`*^9, 3.887770986639593*^9, 3.8879418678410053`*^9, 
   3.887944296492157*^9, 3.8881451038740673`*^9, 3.8883037423744392`*^9, 
   3.8916612260735726`*^9, 3.922499066218789*^9, 3.9235688696393933`*^9, 
   3.9236253212784095`*^9, 3.924583032421088*^9, 3.92639340364045*^9, 
   3.926997903262512*^9, 3.9270838863085327`*^9, 3.927085599787247*^9, 
   3.927086928378899*^9},
 CellLabel->
  "Out[373]=",ExpressionUUID->"2aa23908-7dde-4c8f-a3fc-a899ead63fb2"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
    "Now", " ", "we", " ", "determine", " ", "the", " ", "fixed", " ", "fee", 
     " ", "for", " ", "the", " ", "higher", " ", "types", " ", 
     RowBox[{"(", 
      RowBox[{"by", " ", "continuity", " ", "of", " ", "payments"}], ")"}]}], 
    ":"}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"(", 
         RowBox[{
          RowBox[{"a1", " ", "q1"}], "+", 
          RowBox[{"a2", " ", 
           RowBox[{"q1", "^", "2"}]}], "+", 
          RowBox[{"b1", " ", "q2"}], "+", 
          RowBox[{"b2", " ", 
           RowBox[{"q2", "^", "2"}]}]}], ")"}], "+", "Kconstrbasso"}], "/.", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"q1", "\[Rule]", "q1bind"}], ",", 
         RowBox[{"q2", "\[Rule]", "q2bind"}]}], "}"}]}], "/.", "contrbind"}], 
     "/.", 
     RowBox[{"\[Theta]", "->", "\[Theta]switch"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"(", 
         RowBox[{
          RowBox[{"a1", " ", "q1"}], "+", 
          RowBox[{"a2", " ", 
           RowBox[{"q1", "^", "2"}]}], "+", 
          RowBox[{"b1", " ", "q2"}], "+", 
          RowBox[{"b2", " ", 
           RowBox[{"q2", "^", "2"}]}]}], ")"}], "+", "k"}], "/.", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"q1", "\[Rule]", "q1sol"}], ",", 
         RowBox[{"q2", "\[Rule]", "q2sol"}]}], "}"}]}], "/.", "contr"}], "/.", 
     RowBox[{"\[Theta]", "->", "\[Theta]switch"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"Kconstralto", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{"%", "\[Equal]", "%%"}], ",", "k"}], "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}], 
   "\[IndentingNewLine]"}]}]], "Input",
 CellChangeTimes->{{3.8865663326938753`*^9, 3.8865664507578125`*^9}, {
  3.9235688811843557`*^9, 3.923568901675249*^9}, {3.923625324283558*^9, 
  3.9236253304150157`*^9}},
 CellLabel->
  "In[374]:=",ExpressionUUID->"7c913ed4-8dc5-4d15-a8aa-aa953de715dc"],

Cell[BoxData[
 FractionBox[
  RowBox[{
   RowBox[{
    RowBox[{"-", "6"}], " ", "c", " ", 
    RowBox[{"(", 
     RowBox[{"1", "+", "d"}], ")"}], " ", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], "2"]}], "+", 
   RowBox[{"2", " ", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{"1", "+", "d"}], ")"}], "2"], " ", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], "2"]}], "+", 
   RowBox[{
    SuperscriptBox["c", "2"], " ", 
    RowBox[{"(", 
     RowBox[{"3", "+", 
      RowBox[{"\[Gamma]", " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"-", "4"}], "+", 
         RowBox[{"3", " ", "\[Gamma]"}]}], ")"}]}]}], ")"}]}]}], 
  RowBox[{"4", " ", 
   RowBox[{"(", 
    RowBox[{
     RowBox[{"-", "3"}], "+", "\[Gamma]"}], ")"}], " ", 
   SuperscriptBox[
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], "2"]}]]], "Output",
 CellChangeTimes->{{3.886566437317421*^9, 3.886566451122855*^9}, 
   3.886656793760878*^9, 3.8877709869269795`*^9, 3.8879418679967017`*^9, 
   3.8879443088538218`*^9, 3.888145104126331*^9, 3.8883037425842505`*^9, 
   3.8916612262312613`*^9, 3.9224990663190784`*^9, 3.9235689024613905`*^9, 
   3.9236253327710547`*^9, 3.924583032490177*^9, 3.926393409886992*^9, 
   3.9269979033920794`*^9, 3.927083886418166*^9, 3.9270856000301523`*^9, 
   3.9270869387563896`*^9},
 CellLabel->
  "Out[376]=",ExpressionUUID->"07d92677-56b4-4730-91fd-a2de52beb57f"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
   "Now", " ", "we", " ", "define", " ", "the", " ", "profits", " ", "of", 
    " ", "the", " ", "constrained", " ", 
    RowBox[{"case", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"(", 
         RowBox[{
          RowBox[{"a1", " ", "q1"}], "+", 
          RowBox[{"a2", " ", 
           RowBox[{"q1", "^", "2"}]}], "+", 
          RowBox[{"b1", " ", "q2"}], "+", 
          RowBox[{"b2", " ", 
           RowBox[{"q2", "^", "2"}]}]}], ")"}], "-", 
        RowBox[{"c", " ", "q2"}], "+", "Kconstrbasso"}], "/.", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"q1", "\[Rule]", "q1bind"}], ",", 
         RowBox[{"q2", "\[Rule]", "q2bind"}]}], "}"}]}], "/.", "contrbind"}], 
     "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Integrate", "[", 
     RowBox[{
      RowBox[{"%", " ", "f"}], ",", 
      RowBox[{"{", 
       RowBox[{"\[Theta]", ",", 
        RowBox[{"-", "d"}], ",", "\[Theta]switch"}], "}"}]}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"(", 
         RowBox[{
          RowBox[{"a1", " ", "q1"}], "+", 
          RowBox[{"a2", " ", 
           RowBox[{"q1", "^", "2"}]}], "+", 
          RowBox[{"b1", " ", "q2"}], "+", 
          RowBox[{"b2", " ", 
           RowBox[{"q2", "^", "2"}]}]}], ")"}], "-", 
        RowBox[{"c", " ", "q2"}], "+", "Kconstralto"}], "/.", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"q1", "\[Rule]", "q1sol"}], ",", 
         RowBox[{"q2", "\[Rule]", "q2sol"}]}], "}"}]}], "/.", "contr"}], 
     "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Integrate", "[", 
     RowBox[{
      RowBox[{"%", " ", "f"}], ",", 
      RowBox[{"{", 
       RowBox[{"\[Theta]", ",", "\[Theta]switch", ",", "d"}], "}"}]}], "]"}], 
    ";"}], "\[IndentingNewLine]", 
   RowBox[{"ProfitRBconstrained", "=", 
    RowBox[{"FullSimplify", "[", 
     RowBox[{"%", "+", "%%%"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.8865658434108105`*^9, 3.886565888188881*^9}, {
  3.8865666303978643`*^9, 3.8865666968055787`*^9}, {3.9235689172422314`*^9, 
  3.9235689264659185`*^9}, {3.926393413428884*^9, 3.9263934242003345`*^9}},
 CellLabel->
  "In[377]:=",ExpressionUUID->"49d7be8f-1f1a-4868-ae5f-670d743914b6"],

Cell[BoxData[
 FractionBox[
  RowBox[{
   FractionBox[
    RowBox[{"4", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "7"}], "+", "\[Gamma]"}], ")"}], " ", 
     SuperscriptBox[
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "1"}], "+", 
        RowBox[{"d", " ", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}]}], "+", "\[Gamma]", 
        "-", 
        RowBox[{"c", " ", "\[Gamma]"}]}], ")"}], "3"]}], 
    RowBox[{
     SuperscriptBox[
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "3"}], "+", "\[Gamma]"}], ")"}], "3"], " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", 
       SuperscriptBox["\[Gamma]", "2"]}], ")"}]}]], "-", 
   FractionBox[
    RowBox[{
     RowBox[{"-", 
      FractionBox[
       RowBox[{"8", " ", 
        SuperscriptBox[
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", "1"}], "+", 
           RowBox[{"d", " ", 
            RowBox[{"(", 
             RowBox[{
              RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}]}], "+", "\[Gamma]",
            "-", 
           RowBox[{"c", " ", "\[Gamma]"}]}], ")"}], "3"]}], 
       SuperscriptBox[
        RowBox[{"(", 
         RowBox[{
          RowBox[{"-", "3"}], "+", "\[Gamma]"}], ")"}], "3"]]}], "+", 
     SuperscriptBox[
      RowBox[{"(", 
       RowBox[{"1", "-", "d", "+", 
        RowBox[{
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", "1"}], "+", "c", "+", "d"}], ")"}], " ", 
         "\[Gamma]"}]}], ")"}], "3"]}], 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], "2"]]}], 
  RowBox[{"24", " ", "d"}]]], "Output",
 CellChangeTimes->{
  3.886565893066221*^9, 3.8865667234270444`*^9, 3.8866568000466766`*^9, 
   3.8877709942720866`*^9, 3.8879418730241394`*^9, 3.8879443290181723`*^9, 
   3.888145111429164*^9, 3.888303747185932*^9, 3.8916612325051975`*^9, 
   3.9224990694116983`*^9, 3.9235689312513885`*^9, 3.923625348267089*^9, 
   3.9245830355651712`*^9, {3.926393419722898*^9, 3.9263934275355244`*^9}, 
   3.9269979065994463`*^9, 3.927083888565175*^9, 3.92708560441147*^9, 
   3.9270869465190225`*^9},
 CellLabel->
  "Out[381]=",ExpressionUUID->"9ac86eca-f06f-4120-92d0-3d7037d84da1"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"And", " ", "the", " ", "Consumer", " ", 
    RowBox[{"surplus", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{
       RowBox[{"u", "-", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{"a1", " ", "q1"}], "+", 
          RowBox[{"a2", " ", 
           RowBox[{"q1", "^", "2"}]}], "+", 
          RowBox[{"b1", " ", "q2"}], "+", 
          RowBox[{"b2", " ", 
           RowBox[{"q2", "^", "2"}]}]}], ")"}], "-", "Kconstrbasso"}], "/.", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"q1", "\[Rule]", "q1bind"}], ",", 
         RowBox[{"q2", "\[Rule]", "q2bind"}]}], "}"}]}], "/.", "contrbind"}], 
     "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Integrate", "[", 
     RowBox[{
      RowBox[{"%", " ", "f"}], ",", 
      RowBox[{"{", 
       RowBox[{"\[Theta]", ",", 
        RowBox[{"-", "d"}], ",", "\[Theta]switch"}], "}"}]}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{
       RowBox[{"u", "-", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{"a1", " ", "q1"}], "+", 
          RowBox[{"a2", " ", 
           RowBox[{"q1", "^", "2"}]}], "+", 
          RowBox[{"b1", " ", "q2"}], "+", 
          RowBox[{"b2", " ", 
           RowBox[{"q2", "^", "2"}]}]}], ")"}], "-", "Kconstralto"}], "/.", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"q1", "\[Rule]", "q1sol"}], ",", 
         RowBox[{"q2", "\[Rule]", "q2sol"}]}], "}"}]}], "/.", "contr"}], 
     "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Integrate", "[", 
     RowBox[{
      RowBox[{"%", " ", "f"}], ",", 
      RowBox[{"{", 
       RowBox[{"\[Theta]", ",", "\[Theta]switch", ",", "d"}], "}"}]}], "]"}], 
    ";"}], "\[IndentingNewLine]", 
   RowBox[{"CSRBconstr", "=", 
    RowBox[{"FullSimplify", "[", 
     RowBox[{"%", "+", "%%%"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.8880441555991015`*^9, 3.888044188987033*^9}, {
  3.9235689299814315`*^9, 3.9235689338871126`*^9}, {3.9263934311320477`*^9, 
  3.92639343318836*^9}},
 CellLabel->
  "In[382]:=",ExpressionUUID->"1c71f49e-eed1-4388-bb0a-9668a969603e"],

Cell[BoxData[
 RowBox[{
  FractionBox["1", 
   RowBox[{"12", " ", "d", " ", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "3"}], "+", "\[Gamma]"}], ")"}], "2"], " ", 
    RowBox[{"(", 
     RowBox[{"1", "+", "\[Gamma]"}], ")"}]}]], 
  RowBox[{"(", 
   RowBox[{
    RowBox[{"3", " ", 
     SuperscriptBox["d", "2"], " ", 
     SuperscriptBox[
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], "2"], " ", 
     RowBox[{"(", 
      RowBox[{"1", "+", 
       RowBox[{
        RowBox[{"(", 
         RowBox[{
          RowBox[{"-", "1"}], "+", "c"}], ")"}], " ", "\[Gamma]"}]}], ")"}]}],
     "+", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{"1", "+", 
       RowBox[{
        RowBox[{"(", 
         RowBox[{
          RowBox[{"-", "1"}], "+", "c"}], ")"}], " ", "\[Gamma]"}]}], ")"}], 
     "3"], "+", 
    RowBox[{
     SuperscriptBox["d", "3"], " ", 
     RowBox[{"(", 
      RowBox[{"19", "+", 
       RowBox[{"\[Gamma]", " ", 
        RowBox[{"(", 
         RowBox[{"3", "+", 
          RowBox[{
           RowBox[{"(", 
            RowBox[{
             RowBox[{"-", "7"}], "+", "\[Gamma]"}], ")"}], " ", 
           "\[Gamma]"}]}], ")"}]}]}], ")"}]}], "+", 
    RowBox[{"3", " ", "d", " ", 
     RowBox[{"(", 
      RowBox[{"19", "+", 
       RowBox[{"\[Gamma]", " ", 
        RowBox[{"(", 
         RowBox[{"3", "+", 
          RowBox[{
           RowBox[{"(", 
            RowBox[{
             RowBox[{"-", "7"}], "+", "\[Gamma]"}], ")"}], " ", 
           "\[Gamma]"}]}], ")"}]}], "+", 
       RowBox[{
        SuperscriptBox["c", "2"], " ", 
        RowBox[{"(", 
         RowBox[{"18", "+", 
          RowBox[{"\[Gamma]", " ", 
           RowBox[{"(", 
            RowBox[{"6", "+", 
             RowBox[{
              RowBox[{"(", 
               RowBox[{
                RowBox[{"-", "9"}], "+", "\[Gamma]"}], ")"}], " ", 
              "\[Gamma]"}]}], ")"}]}]}], ")"}]}], "-", 
       RowBox[{"2", " ", "c", " ", 
        RowBox[{"(", 
         RowBox[{"18", "+", 
          RowBox[{"\[Gamma]", " ", 
           RowBox[{"(", 
            RowBox[{"5", "+", 
             RowBox[{
              RowBox[{"(", 
               RowBox[{
                RowBox[{"-", "8"}], "+", "\[Gamma]"}], ")"}], " ", 
              "\[Gamma]"}]}], ")"}]}]}], ")"}]}]}], ")"}]}]}], 
   ")"}]}]], "Output",
 CellChangeTimes->{3.8880441922464156`*^9, 3.8881451142486687`*^9, 
  3.8883037494349637`*^9, 3.8916612358293934`*^9, 3.922499070926279*^9, 
  3.9235689361798277`*^9, 3.9236253561378546`*^9, 3.924583037242334*^9, 
  3.926393436110732*^9, 3.9269979088787575`*^9, 3.9270838920721045`*^9, 
  3.927085611354709*^9, 3.9270869490764794`*^9},
 CellLabel->
  "Out[386]=",ExpressionUUID->"891e102a-fd6c-4838-a4b8-43097c511092"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"Line", "[", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"Allconstrained", ",", "0"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"Allconstrained", ",", "1"}], "}"}]}], "}"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Line", "[", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"Doutside", ",", "0"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"Doutside", ",", "1"}], "}"}]}], "}"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"{", 
   RowBox[{"ProfitRBunconstr", ",", "ProfitRBconstrained"}], "}"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"Manipulate", "[", 
  RowBox[{
   RowBox[{"Plot", "[", 
    RowBox[{"%", ",", 
     RowBox[{"{", 
      RowBox[{"d", ",", "0", ",", "1"}], "}"}], ",", 
     RowBox[{"Epilog", "\[Rule]", 
      RowBox[{"{", 
       RowBox[{"%%", ",", "%%%"}], "}"}]}]}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"c", ",", "0.1"}], "}"}], ",", "0", ",", 
     RowBox[{"1", "/", "2"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"\[Gamma]", ",", "0.3"}], "}"}], ",", "0", ",", "1"}], "}"}]}], 
  "]"}]}], "Input",
 CellChangeTimes->{{3.8865667636314926`*^9, 3.8865667671493874`*^9}, {
   3.8865668797219763`*^9, 3.8865669903208237`*^9}, 3.887945016753379*^9, {
   3.9235689622298613`*^9, 3.9235689634622526`*^9}},
 CellLabel->
  "In[387]:=",ExpressionUUID->"c38309d0-4380-45da-b50f-0f69b11e9e8d"],

Cell[BoxData[
 TagBox[
  StyleBox[
   DynamicModuleBox[{$CellContext`c$$ = 0.1, $CellContext`\[Gamma]$$ = 0.3, 
    Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, 
    Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 
    1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{
       Hold[$CellContext`c$$], 0.1}, 0, 
      Rational[1, 2]}, {{
       Hold[$CellContext`\[Gamma]$$], 0.3}, 0, 1}}, Typeset`size$$ = {
    360., {108., 112.1967439688745}}, Typeset`update$$ = 0, 
    Typeset`initDone$$, Typeset`skipInitDone$$ = True}, 
    DynamicBox[Manipulate`ManipulateBoxes[
     1, StandardForm, 
      "Variables" :> {$CellContext`c$$ = 0.1, $CellContext`\[Gamma]$$ = 0.3}, 
      "ControllerVariables" :> {}, 
      "OtherVariables" :> {
       Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, 
        Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, 
        Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$,
         Typeset`skipInitDone$$}, "Body" :> 
      Plot[{Rational[1, 6] (-1 + $CellContext`\[Gamma]$$^2)^(-1) (-3 + 
          6 $CellContext`d - 11 $CellContext`d^2 + 
          2 (3 + 3 $CellContext`c$$ (-1 + $CellContext`d) + $CellContext`d \
(-6 + 7 $CellContext`d)) $CellContext`\[Gamma]$$ - 
          3 (-1 + $CellContext`c$$ + $CellContext`d)^2 \
$CellContext`\[Gamma]$$^2), 
         Rational[1, 24] $CellContext`d^(-1) (
          4 (-7 + $CellContext`\[Gamma]$$) (-3 + \
$CellContext`\[Gamma]$$)^(-3) (-1 + $CellContext`d (-1 + \
$CellContext`\[Gamma]$$) + $CellContext`\[Gamma]$$ - $CellContext`c$$ \
$CellContext`\[Gamma]$$)^3/(-1 + $CellContext`\[Gamma]$$^2) - (-1 + \
$CellContext`\[Gamma]$$)^(-2) ((-8) (-3 + $CellContext`\[Gamma]$$)^(-3) (-1 + \
$CellContext`d (-1 + $CellContext`\[Gamma]$$) + $CellContext`\[Gamma]$$ - \
$CellContext`c$$ $CellContext`\[Gamma]$$)^3 + (
             1 - $CellContext`d + (-1 + $CellContext`c$$ + $CellContext`d) \
$CellContext`\[Gamma]$$)^3))}, {$CellContext`d, 0, 1}, Epilog -> {
          
          Line[{{(-5 + $CellContext`\[Gamma]$$)^(-1) (-1 + $CellContext`\
\[Gamma]$$ - $CellContext`c$$ $CellContext`\[Gamma]$$), 
             0}, {(-5 + $CellContext`\[Gamma]$$)^(-1) (-1 + $CellContext`\
\[Gamma]$$ - $CellContext`c$$ $CellContext`\[Gamma]$$), 1}}], 
          
          Line[{{-1 + $CellContext`c$$ (-1 + $CellContext`\[Gamma]$$)^(-1) \
$CellContext`\[Gamma]$$, 
             0}, {-1 + $CellContext`c$$ (-1 + $CellContext`\[Gamma]$$)^(-1) \
$CellContext`\[Gamma]$$, 1}}]}], 
      "Specifications" :> {{{$CellContext`c$$, 0.1}, 0, 
         Rational[1, 2]}, {{$CellContext`\[Gamma]$$, 0.3}, 0, 1}}, 
      "Options" :> {}, "DefaultOptions" :> {}],
     ImageSizeCache->{817., {137., 143.}},
     SingleEvaluation->True],
    Deinitialization:>None,
    DynamicModuleValues:>{},
    SynchronousInitialization->True,
    UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$},
    UnsavedVariables:>{Typeset`initDone$$},
    UntrackedVariables:>{Typeset`size$$}], "Manipulate",
   Deployed->True,
   StripOnInput->False],
  Manipulate`InterpretManipulate[1]]], "Output",
 CellChangeTimes->{
  3.8865667678478985`*^9, {3.886566896066041*^9, 3.886566907428291*^9}, {
   3.886566939490181*^9, 3.8865669684733963`*^9}, 3.8866568002631216`*^9, 
   3.887770994678135*^9, 3.8879418732504077`*^9, 3.8879450175447364`*^9, 
   3.888145114921093*^9, 3.88830375000243*^9, 3.8916612362603807`*^9, 
   3.9224990712068925`*^9, 3.9235689660317564`*^9, 3.9236253589379253`*^9, 
   3.9245830372604976`*^9, 3.9269979089236064`*^9, 3.927083892145858*^9, 
   3.92708561147132*^9, 3.927086949161211*^9},
 CellLabel->
  "Out[390]=",ExpressionUUID->"c464bd9b-d746-4b38-aef2-b55c4913af0a"]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
   "Final", " ", "definition", " ", "of", " ", "profits", " ", "and", " ", 
    "consumer", " ", "surplus", " ", "in", " ", "the", " ", "different", " ", 
    "cases"}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"ProfitRBall", "=", 
     RowBox[{"Piecewise", "[", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"{", 
         RowBox[{"ProfitRBconstrained", ",", 
          RowBox[{"d", "\[GreaterEqual]", "Doutside"}]}], " ", "}"}], ",", 
        RowBox[{"{", 
         RowBox[{"ProfitRBunconstr", ",", 
          RowBox[{"d", "\[LessEqual]", "Doutside"}]}], "}"}]}], "}"}], 
      "]"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"CSRBall", "=", 
     RowBox[{"Piecewise", "[", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"{", 
         RowBox[{"CSRBconstr", ",", 
          RowBox[{"d", "\[GreaterEqual]", "Doutside"}]}], " ", "}"}], ",", 
        RowBox[{"{", 
         RowBox[{"CSRBunconstr", ",", 
          RowBox[{"d", "\[LessEqual]", "Doutside"}]}], "}"}]}], "}"}], 
      "]"}]}], ";"}]}]}]], "Input",
 CellChangeTimes->{{3.886568479538556*^9, 3.8865685166917534`*^9}, {
  3.8880442998440976`*^9, 3.888044323780181*^9}, {3.9235689712296906`*^9, 
  3.9235689847474747`*^9}, {3.927085318238422*^9, 3.927085319156938*^9}},
 CellLabel->
  "In[391]:=",ExpressionUUID->"ab35a841-513b-416a-951d-feaf06107d62"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"Line", "[", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"Doutside", ",", "0"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"Doutside", ",", "1"}], "}"}]}], "}"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"{", 
   RowBox[{
   "ProfitRBunconstr", ",", "ProfitRBconstrained", ",", "ProfitRBall"}], 
   "}"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"Manipulate", "[", 
  RowBox[{
   RowBox[{"Plot", "[", 
    RowBox[{"%", ",", 
     RowBox[{"{", 
      RowBox[{"d", ",", "0", ",", "1"}], "}"}], ",", 
     RowBox[{"Epilog", "\[Rule]", 
      RowBox[{"{", "%%", "}"}]}]}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"c", ",", "0.1"}], "}"}], ",", "0", ",", 
     RowBox[{"1", "/", "2"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"\[Gamma]", ",", "0.3"}], "}"}], ",", "0", ",", "1"}], "}"}]}], 
  "]"}]}], "Input",
 CellChangeTimes->{{3.8865685424593678`*^9, 3.886568545205942*^9}},
 CellLabel->
  "In[393]:=",ExpressionUUID->"23405d20-1982-4698-9324-94967bc411b5"],

Cell[BoxData[
 TagBox[
  StyleBox[
   DynamicModuleBox[{$CellContext`c$$ = 0.1, $CellContext`\[Gamma]$$ = 0.3, 
    Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, 
    Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 
    1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{
       Hold[$CellContext`c$$], 0.1}, 0, 
      Rational[1, 2]}, {{
       Hold[$CellContext`\[Gamma]$$], 0.3}, 0, 1}}, Typeset`size$$ = {
    360., {106., 110.90161377375387`}}, Typeset`update$$ = 0, 
    Typeset`initDone$$, Typeset`skipInitDone$$ = True}, 
    DynamicBox[Manipulate`ManipulateBoxes[
     1, StandardForm, 
      "Variables" :> {$CellContext`c$$ = 0.1, $CellContext`\[Gamma]$$ = 0.3}, 
      "ControllerVariables" :> {}, 
      "OtherVariables" :> {
       Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, 
        Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, 
        Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$,
         Typeset`skipInitDone$$}, "Body" :> 
      Plot[{Rational[1, 6] (-1 + $CellContext`\[Gamma]$$^2)^(-1) (-3 + 
          6 $CellContext`d - 11 $CellContext`d^2 + 
          2 (3 + 3 $CellContext`c$$ (-1 + $CellContext`d) + $CellContext`d \
(-6 + 7 $CellContext`d)) $CellContext`\[Gamma]$$ - 
          3 (-1 + $CellContext`c$$ + $CellContext`d)^2 \
$CellContext`\[Gamma]$$^2), 
         Rational[1, 24] $CellContext`d^(-1) (
          4 (-7 + $CellContext`\[Gamma]$$) (-3 + \
$CellContext`\[Gamma]$$)^(-3) (-1 + $CellContext`d (-1 + \
$CellContext`\[Gamma]$$) + $CellContext`\[Gamma]$$ - $CellContext`c$$ \
$CellContext`\[Gamma]$$)^3/(-1 + $CellContext`\[Gamma]$$^2) - (-1 + \
$CellContext`\[Gamma]$$)^(-2) ((-8) (-3 + $CellContext`\[Gamma]$$)^(-3) (-1 + \
$CellContext`d (-1 + $CellContext`\[Gamma]$$) + $CellContext`\[Gamma]$$ - \
$CellContext`c$$ $CellContext`\[Gamma]$$)^3 + (
             1 - $CellContext`d + (-1 + $CellContext`c$$ + $CellContext`d) \
$CellContext`\[Gamma]$$)^3)), 
         Piecewise[{{
           Rational[1, 24] $CellContext`d^(-1) (
             
             4 (-7 + $CellContext`\[Gamma]$$) (-3 + \
$CellContext`\[Gamma]$$)^(-3) (-1 + $CellContext`d (-1 + \
$CellContext`\[Gamma]$$) + $CellContext`\[Gamma]$$ - $CellContext`c$$ \
$CellContext`\[Gamma]$$)^3/(-1 + $CellContext`\[Gamma]$$^2) - (-1 + \
$CellContext`\[Gamma]$$)^(-2) ((-8) (-3 + $CellContext`\[Gamma]$$)^(-3) (-1 + \
$CellContext`d (-1 + $CellContext`\[Gamma]$$) + $CellContext`\[Gamma]$$ - \
$CellContext`c$$ $CellContext`\[Gamma]$$)^3 + (
                1 - $CellContext`d + (-1 + $CellContext`c$$ + $CellContext`d) \
$CellContext`\[Gamma]$$)^3)), $CellContext`d >= (-5 + \
$CellContext`\[Gamma]$$)^(-1) (-1 + $CellContext`\[Gamma]$$ - \
$CellContext`c$$ $CellContext`\[Gamma]$$)}, {
           Rational[1, 6] (-1 + $CellContext`\[Gamma]$$^2)^(-1) (-3 + 
             6 $CellContext`d - 11 $CellContext`d^2 + 
             2 (3 + 3 $CellContext`c$$ (-1 + $CellContext`d) + $CellContext`d \
(-6 + 7 $CellContext`d)) $CellContext`\[Gamma]$$ - 
             3 (-1 + $CellContext`c$$ + $CellContext`d)^2 $CellContext`\
\[Gamma]$$^2), $CellContext`d <= (-5 + $CellContext`\[Gamma]$$)^(-1) (-1 + \
$CellContext`\[Gamma]$$ - $CellContext`c$$ $CellContext`\[Gamma]$$)}}, 
          0]}, {$CellContext`d, 0, 1}, Epilog -> {
          
          Line[{{(-5 + $CellContext`\[Gamma]$$)^(-1) (-1 + $CellContext`\
\[Gamma]$$ - $CellContext`c$$ $CellContext`\[Gamma]$$), 
             0}, {(-5 + $CellContext`\[Gamma]$$)^(-1) (-1 + $CellContext`\
\[Gamma]$$ - $CellContext`c$$ $CellContext`\[Gamma]$$), 1}}]}], 
      "Specifications" :> {{{$CellContext`c$$, 0.1}, 0, 
         Rational[1, 2]}, {{$CellContext`\[Gamma]$$, 0.3}, 0, 1}}, 
      "Options" :> {}, "DefaultOptions" :> {}],
     ImageSizeCache->{817., {135., 141.}},
     SingleEvaluation->True],
    Deinitialization:>None,
    DynamicModuleValues:>{},
    SynchronousInitialization->True,
    UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$},
    UnsavedVariables:>{Typeset`initDone$$},
    UntrackedVariables:>{Typeset`size$$}], "Manipulate",
   Deployed->True,
   StripOnInput->False],
  Manipulate`InterpretManipulate[1]]], "Output",
 CellChangeTimes->{3.886568546435171*^9, 3.886656800471569*^9, 
  3.887770995104309*^9, 3.887941873682865*^9, 3.888145115096387*^9, 
  3.88830375015065*^9, 3.8916612363750734`*^9, 3.9224990712370634`*^9, 
  3.9235689887773867`*^9, 3.92362536979626*^9, 3.9245830372917757`*^9, 
  3.9269979089704504`*^9, 3.927083892299095*^9, 3.9270856115615935`*^9, 
  3.9270869552525*^9},
 CellLabel->
  "Out[395]=",ExpressionUUID->"1c3bbf9c-d407-488f-8127-b18b1167f752"]
}, Open  ]],

Cell[BoxData[
 RowBox[{"(*", 
  RowBox[{
  "Now", " ", "we", " ", "perform", " ", "an", " ", "analysis", " ", "of", 
   " ", "compatibility", " ", "of", " ", "the", " ", "different", " ", 
   RowBox[{"cases", "."}]}], "*)"}]], "Input",
 CellChangeTimes->{{3.9235690067514253`*^9, 3.923569021954385*^9}, 
   3.923569280570294*^9},
 CellLabel->
  "In[135]:=",ExpressionUUID->"e2364a72-af9a-46cb-8bda-a7be1cdfd970"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"{", 
   RowBox[{"Dq2sol", ",", "Doutside", ",", 
    RowBox[{"1", "-", "c"}], ",", 
    RowBox[{"c", "/", "2"}], ",", 
    FractionBox[
     RowBox[{
      RowBox[{"-", "1"}], "+", "c", "+", "\[Gamma]"}], 
     RowBox[{
      RowBox[{"-", "1"}], "+", "\[Gamma]"}]]}], "}"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"Manipulate", "[", 
  RowBox[{
   RowBox[{"Plot", "[", 
    RowBox[{"%", ",", 
     RowBox[{"{", 
      RowBox[{"\[Gamma]", ",", "0", ",", "1"}], "}"}], ",", 
     RowBox[{"PlotRange", "\[Rule]", 
      RowBox[{"{", 
       RowBox[{"0", ",", "1"}], "}"}]}]}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"c", ",", "0.3"}], "}"}], ",", "0", ",", 
     RowBox[{"1", "/", "2"}]}], "}"}]}], "]"}]}], "Input",
 CellChangeTimes->{{3.885624194693862*^9, 3.8856242279065075`*^9}, {
   3.885625664921941*^9, 3.8856256883636656`*^9}, {3.8856257707207427`*^9, 
   3.885625771570675*^9}, 3.8857114493086953`*^9, {3.8857115961512685`*^9, 
   3.885711600050667*^9}, {3.885886912911872*^9, 3.8858869574946465`*^9}, {
   3.885887087822647*^9, 3.88588708944847*^9}, {3.8858871980432625`*^9, 
   3.8858871997177815`*^9}, 3.8858876928736715`*^9, {3.8858877325857773`*^9, 
   3.8858877344574537`*^9}, 3.8858877742418704`*^9, {3.888028483256155*^9, 
   3.8880284837883368`*^9}, {3.888028617511106*^9, 3.8880286329894247`*^9}},
 CellLabel->
  "In[136]:=",ExpressionUUID->"97ed8242-c0ea-4334-96bd-bbff356c51b5"],

Cell[BoxData[
 TagBox[
  StyleBox[
   DynamicModuleBox[{$CellContext`c$$ = 0.3, Typeset`show$$ = True, 
    Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", 
    Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = 
    "\"untitled\"", Typeset`specs$$ = {{{
       Hold[$CellContext`c$$], 0.3}, 0, 
      Rational[1, 2]}}, Typeset`size$$ = {360., {116., 120.24657259881528`}}, 
    Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True}, 
    DynamicBox[Manipulate`ManipulateBoxes[
     1, StandardForm, "Variables" :> {$CellContext`c$$ = 0.3}, 
      "ControllerVariables" :> {}, 
      "OtherVariables" :> {
       Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, 
        Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, 
        Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$,
         Typeset`skipInitDone$$}, "Body" :> 
      Plot[{Rational[
          1, 3] (-1 + $CellContext`\[Gamma])^(-1) (-1 + $CellContext`c$$ + \
$CellContext`\[Gamma]), (-5 + $CellContext`\[Gamma])^(-1) (-1 + $CellContext`\
\[Gamma] - $CellContext`c$$ $CellContext`\[Gamma]), 1 - $CellContext`c$$, 
         Rational[
          1, 2] $CellContext`c$$, (-1 + $CellContext`\[Gamma])^(-1) (-1 + \
$CellContext`c$$ + $CellContext`\[Gamma])}, {$CellContext`\[Gamma], 0, 1}, 
        PlotRange -> {0, 1}], 
      "Specifications" :> {{{$CellContext`c$$, 0.3}, 0, 
         Rational[1, 2]}}, "Options" :> {}, "DefaultOptions" :> {}],
     ImageSizeCache->{817., {145., 151.}},
     SingleEvaluation->True],
    Deinitialization:>None,
    DynamicModuleValues:>{},
    SynchronousInitialization->True,
    UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$},
    UnsavedVariables:>{Typeset`initDone$$},
    UntrackedVariables:>{Typeset`size$$}], "Manipulate",
   Deployed->True,
   StripOnInput->False],
  Manipulate`InterpretManipulate[1]]], "Output",
 CellChangeTimes->{{3.8856242211137123`*^9, 3.8856242288580265`*^9}, {
   3.8856256668445396`*^9, 3.885625689203541*^9}, 3.8856257725896196`*^9, 
   3.885711450536728*^9, 3.88571160091626*^9, {3.8858869290533304`*^9, 
   3.8858869576617546`*^9}, {3.885887090150016*^9, 3.885887094679163*^9}, 
   3.8858871999184284`*^9, 3.8858876929873953`*^9, 3.8858877346148863`*^9, 
   3.8858877743826885`*^9, 3.8858883467594414`*^9, 3.8866568006690097`*^9, 
   3.887770995383018*^9, 3.887941873783167*^9, 3.888028484263217*^9, {
   3.888028618013054*^9, 3.8880286335140243`*^9}, 3.888028919110594*^9, 
   3.8881451152507887`*^9, 3.8883037502841935`*^9, 3.891661236464361*^9, 
   3.9224990712683372`*^9, 3.9235689949424915`*^9, 3.924583037323004*^9, 
   3.9269979090153008`*^9, 3.927083892591488*^9, 3.927085611648304*^9},
 CellLabel->
  "Out[137]=",ExpressionUUID->"38216fb0-39d8-43ca-96dc-8fb354db4199"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{"FullSimplify", "[", 
  RowBox[{"Solve", "[", 
   RowBox[{
    RowBox[{"Dq2sol", "==", "Doutside"}], ",", "\[Gamma]"}], "]"}], 
  "]"}], "\[IndentingNewLine]", 
 RowBox[{"FullSimplify", "[", 
  RowBox[{"Solve", "[", 
   RowBox[{
    RowBox[{"Dq2sol", "\[Equal]", "0"}], ",", "\[Gamma]"}], "]"}], 
  "]"}], "\[IndentingNewLine]", 
 RowBox[{"Reduce", "[", 
  RowBox[{"{", 
   RowBox[{
    RowBox[{"Dq2sol", ">", "0"}], ",", 
    RowBox[{"1", ">", "d", ">", "0"}], ",", 
    RowBox[{
     RowBox[{"1", "/", "2"}], ">", "c", ">", "0"}], ",", 
    RowBox[{"1", ">", "\[Gamma]", ">", "0"}]}], "}"}], "]"}]}], "Input",
 CellChangeTimes->{{3.885887791412023*^9, 3.885887805194853*^9}, {
  3.8858887531285877`*^9, 3.885888755820465*^9}, {3.9235690440618267`*^9, 
  3.9235690444089265`*^9}},
 CellLabel->
  "In[138]:=",ExpressionUUID->"b7d6448c-bd23-4da7-9153-8f5d2799a196"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"\[Gamma]", "\[Rule]", 
     RowBox[{"-", "1"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"\[Gamma]", "\[Rule]", 
     FractionBox[
      RowBox[{"2", "-", 
       RowBox[{"5", " ", "c"}]}], 
      RowBox[{"2", "-", 
       RowBox[{"3", " ", "c"}]}]]}], "}"}]}], "}"}]], "Output",
 CellChangeTimes->{3.88588780562784*^9, 3.8858887560210943`*^9, 
  3.886656800757806*^9, 3.8877709955957775`*^9, 3.8879418738676796`*^9, 
  3.8881451153947506`*^9, 3.8883037504025683`*^9, 3.8916612365445395`*^9, 
  3.922499071283988*^9, 3.923569044878474*^9, 3.924583037354346*^9, 
  3.9269979090521836`*^9, 3.9270838927124863`*^9, 3.927085611725379*^9},
 CellLabel->
  "Out[138]=",ExpressionUUID->"ef5011f4-ecf2-4f69-b88f-d7f5830fbc6e"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"{", 
   RowBox[{"\[Gamma]", "\[Rule]", 
    RowBox[{"1", "-", "c"}]}], "}"}], "}"}]], "Output",
 CellChangeTimes->{3.88588780562784*^9, 3.8858887560210943`*^9, 
  3.886656800757806*^9, 3.8877709955957775`*^9, 3.8879418738676796`*^9, 
  3.8881451153947506`*^9, 3.8883037504025683`*^9, 3.8916612365445395`*^9, 
  3.922499071283988*^9, 3.923569044878474*^9, 3.924583037354346*^9, 
  3.9269979090521836`*^9, 3.9270838927124863`*^9, 3.9270856117323546`*^9},
 CellLabel->
  "Out[139]=",ExpressionUUID->"ba9e5c68-c405-4ba8-b5d4-61b8704503d0"],

Cell[BoxData[
 RowBox[{
  RowBox[{"0", "<", "d", "<", "1"}], "&&", 
  RowBox[{"(", 
   RowBox[{
    RowBox[{"(", 
     RowBox[{
      RowBox[{"0", "<", "\[Gamma]", "\[LessEqual]", 
       FractionBox["1", "2"]}], "&&", 
      RowBox[{"0", "<", "c", "<", 
       FractionBox["1", "2"]}]}], ")"}], "||", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{
       FractionBox["1", "2"], "<", "\[Gamma]", "<", "1"}], "&&", 
      RowBox[{"0", "<", "c", "<", 
       RowBox[{"1", "-", "\[Gamma]"}]}]}], ")"}]}], ")"}]}]], "Output",
 CellChangeTimes->{3.88588780562784*^9, 3.8858887560210943`*^9, 
  3.886656800757806*^9, 3.8877709955957775`*^9, 3.8879418738676796`*^9, 
  3.8881451153947506`*^9, 3.8883037504025683`*^9, 3.8916612365445395`*^9, 
  3.922499071283988*^9, 3.923569044878474*^9, 3.924583037354346*^9, 
  3.9269979090521836`*^9, 3.9270838927124863`*^9, 3.9270856117433176`*^9},
 CellLabel->
  "Out[140]=",ExpressionUUID->"e345d27f-abf4-42ee-b652-9e811e869b04"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Reduce", "[", 
  RowBox[{"{", 
   RowBox[{
    RowBox[{"\[Theta]switch", ">", "d"}], ",", 
    RowBox[{"1", ">", "d", ">", "0"}], ",", 
    RowBox[{
     RowBox[{"1", "/", "2"}], ">", "c", ">", "0"}], ",", 
    RowBox[{"1", ">", "\[Gamma]", ">", "0"}]}], "}"}], "]"}]], "Input",
 CellChangeTimes->{{3.88552723504078*^9, 3.8855272376331635`*^9}, {
  3.926400878155296*^9, 3.9264008782899017`*^9}},
 CellLabel->
  "In[141]:=",ExpressionUUID->"7fdba594-8b63-4330-9d19-dc13e8a4ec38"],

Cell[BoxData["False"], "Output",
 CellChangeTimes->{3.9235690722932267`*^9, 3.9245830373603706`*^9, 
  3.9264008807195916`*^9, 3.9269979090860634`*^9, 3.9270838927753253`*^9, 
  3.927085611810096*^9},
 CellLabel->
  "Out[141]=",ExpressionUUID->"32609fba-cc6e-406e-a958-63c23102460b"]
}, Open  ]],

Cell[BoxData[
 RowBox[{"(*", 
  RowBox[{
   RowBox[{
    RowBox[{"Hence", " ", "for", " ", "d"}], "<", 
    RowBox[{
     RowBox[{"c", "/", "2"}], " ", "the", " ", "relevant", " ", "condition", 
     " ", "is", "  ", "\[IndentingNewLine]", "\[Gamma]"}], "\[LessEqual]", 
    " ", 
    RowBox[{
     FractionBox[
      RowBox[{"2", "-", 
       RowBox[{"5", " ", "c"}]}], 
      RowBox[{"2", "-", 
       RowBox[{"3", " ", "c"}]}]], " ", "in", " ", "which", " ", "case", " ", 
     "the", " ", "pasrticipation", " ", "constraint", " ", "binds", " ", 
     "only", " ", "for", " ", "he", " ", "low", " ", "types"}]}], ",", " ", 
   RowBox[{
    RowBox[{"and", " ", "if", " ", "instead", " ", "\[Gamma]"}], ">", 
    RowBox[{
     FractionBox[
      RowBox[{"2", "-", 
       RowBox[{"5", " ", "c"}]}], 
      RowBox[{"2", "-", 
       RowBox[{"3", " ", "c"}]}]], " ", "it", " ", "must", " ", "be", " ", 
     "d"}], "\[LessEqual]", " ", 
    RowBox[{"Dq2sol", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{
       "because", " ", "we", " ", "have", " ", "in", " ", "these", " ", 
        "case", " ", "Dq2sol"}], "<", "Doutside"}], ")"}], " ", "and", " ", 
     "c"}], "<", 
    RowBox[{"1", "-", 
     RowBox[{"\[Gamma]", " ", 
      RowBox[{
       RowBox[{"(", 
        RowBox[{
         RowBox[{
         "which", " ", "is", " ", "also", " ", "necessary", " ", "for", " ", 
          "the", " ", "efficient", " ", "quantity", " ", "being"}], " ", ">", 
         "0"}], ")"}], ".", "\[IndentingNewLine]", "Hence"}], " ", "to", " ", 
      "avoid", " ", "proliferation", " ", "of", " ", "cases", " ", "we", " ", 
      "will", " ", "restraint", " ", "to", " ", "a", " ", "low", " ", 
      "d"}]}]}], ",", " ", 
   RowBox[{
    RowBox[{"that", " ", "is", " ", "d"}], "<", 
    RowBox[{
     RowBox[{"c", "/", "2"}], " ", "where", " ", "the", " ", "constraint", 
     " ", "is", " ", "only", " ", "binding", " ", "for", " ", "the", " ", 
     "low", " ", 
     RowBox[{"type", "."}]}]}]}], "*)"}]], "Input",
 CellChangeTimes->{{3.923569075452918*^9, 3.923569190261166*^9}},
 CellLabel->
  "In[142]:=",ExpressionUUID->"adef222f-8e4e-4894-81f4-ea7eaa0a35a8"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
    "We", " ", "finally", " ", "verify", " ", "the", " ", "disortion", " ", 
     "of", " ", "the", " ", "marginal", " ", "price"}], ",", " ", 
    RowBox[{
     RowBox[{"i", ".", "e", ".", " ", "being"}], " ", "higher", " ", "that", 
     " ", "c", " ", "for", " ", 
     RowBox[{"q2", ":"}]}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"a1", " ", "q1"}], "+", 
      RowBox[{"a2", " ", 
       RowBox[{"q1", "^", "2"}]}], "+", 
      RowBox[{"b1", " ", "q2"}], "+", 
      RowBox[{"b2", " ", 
       RowBox[{"q2", "^", "2"}]}]}], "/.", "contr"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{"D", "[", 
      RowBox[{"%", ",", "q2"}], "]"}], "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{"%", "/.", 
      RowBox[{"q2", "\[Rule]", "q2sol"}]}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"FullSimplify", "[", 
    RowBox[{"%", "-", "c"}], "]"}], "\[IndentingNewLine]", 
   "\[IndentingNewLine]", 
   RowBox[{"(*", 
    RowBox[{
    "And", " ", "similarly", " ", "for", " ", "the", " ", "constrained", " ", 
     "case"}], "*)"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"a1", " ", "q1"}], "+", 
      RowBox[{"a2", " ", 
       RowBox[{"q1", "^", "2"}]}], "+", 
      RowBox[{"b1", " ", "q2"}], "+", 
      RowBox[{"b2", " ", 
       RowBox[{"q2", "^", "2"}]}]}], "/.", "contrbind"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{"D", "[", 
      RowBox[{"%", ",", "q2"}], "]"}], "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{"%", "/.", 
      RowBox[{"q2", "\[Rule]", "q2bind"}]}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"FullSimplify", "[", 
    RowBox[{"%", "-", "c"}], "]"}]}]}]], "Input",
 CellChangeTimes->{{3.885627278336523*^9, 3.8856273475206084`*^9}, {
  3.885627492500391*^9, 3.8856274998858414`*^9}, {3.885887542817813*^9, 
  3.885887571592594*^9}, {3.885919544373725*^9, 3.8859195474282537`*^9}, {
  3.923569197341004*^9, 3.9235692651670876`*^9}},
 CellLabel->
  "In[143]:=",ExpressionUUID->"3ae2c91d-9560-44fb-852b-df99de3a76eb"],

Cell[BoxData[
 RowBox[{"d", "-", "\[Theta]"}]], "Output",
 CellChangeTimes->{{3.8856272963071327`*^9, 3.885627339309585*^9}, {
   3.8856274930650644`*^9, 3.8856275004024673`*^9}, 3.8858875264641323`*^9, {
   3.8859195453073683`*^9, 3.885919548045611*^9}, 3.886656801157253*^9, 
   3.8877709964189463`*^9, 3.8879418742251897`*^9, 3.8881451157080975`*^9, 
   3.8883037507971783`*^9, 3.8916612367172785`*^9, 3.922499071415554*^9, 
   3.9235692276158795`*^9, 3.9235692656076727`*^9, 3.92362544531306*^9, 
   3.9245830374244413`*^9, 3.9264008941343164`*^9, 3.926997909186736*^9, 
   3.9270838929029083`*^9, 3.9270856120194535`*^9},
 CellLabel->
  "Out[146]=",ExpressionUUID->"eb6f1061-bc71-41b7-ab53-7720b78bf702"],

Cell[BoxData[
 RowBox[{
  FractionBox["1", "2"], " ", 
  RowBox[{"(", 
   RowBox[{"1", "+", 
    RowBox[{"\[Gamma]", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "c", "-", "\[Theta]"}], ")"}]}], "+", 
    "\[Theta]"}], ")"}]}]], "Output",
 CellChangeTimes->{{3.8856272963071327`*^9, 3.885627339309585*^9}, {
   3.8856274930650644`*^9, 3.8856275004024673`*^9}, 3.8858875264641323`*^9, {
   3.8859195453073683`*^9, 3.885919548045611*^9}, 3.886656801157253*^9, 
   3.8877709964189463`*^9, 3.8879418742251897`*^9, 3.8881451157080975`*^9, 
   3.8883037507971783`*^9, 3.8916612367172785`*^9, 3.922499071415554*^9, 
   3.9235692276158795`*^9, 3.9235692656076727`*^9, 3.92362544531306*^9, 
   3.9245830374244413`*^9, 3.9264008941343164`*^9, 3.926997909186736*^9, 
   3.9270838929029083`*^9, 3.9270856120772686`*^9},
 CellLabel->
  "Out[150]=",ExpressionUUID->"dc5a5818-5418-4f0c-882b-4c570b05b656"]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["2 Exclusive dealing", "Section",
 CellChangeTimes->{{3.8865747632594404`*^9, 3.8865747656828594`*^9}, {
  3.923623523144647*^9, 
  3.9236235234288344`*^9}},ExpressionUUID->"827b1f76-1abd-4cdd-969d-\
900bdf42df1b"],

Cell[BoxData[
 RowBox[{"(*", 
  RowBox[{
  "Here", " ", "we", " ", "consider", " ", "the", " ", "case", " ", "of", " ",
    "competition", " ", "with", " ", "exclusive", " ", 
   RowBox[{"dealing", ".", " ", "The"}], " ", "efficient", " ", "firm", " ", 
   "1", " ", "wins", " ", "exclusive", " ", 
   RowBox[{"dealing", ".", " ", "Here"}], " ", "we", " ", "characterize", " ",
    "the", " ", "optimal", " ", "contract", " ", "and", " ", "equilibrium", 
   " ", "payoffs", " ", "in", " ", "this", " ", "regime"}], "*)"}]], "Input",
 CellChangeTimes->{{3.923566069580748*^9, 3.9235661201112204`*^9}, {
  3.9236274400802946`*^9, 3.9236274740624743`*^9}},
 CellLabel->
  "In[151]:=",ExpressionUUID->"4ef599c2-5003-4059-95db-95dacedade0f"],

Cell[BoxData[
 RowBox[{"(*", 
  RowBox[{"There", " ", "are", " ", "two", " ", 
   RowBox[{"cases", ":", " ", 
    RowBox[{
    "one", " ", "with", " ", "unconstrained", " ", "optimization", " ", "by", 
     " ", "seller", " ", "1", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"i", ".", "e", ".", " ", "the"}], " ", "participation", " ", 
       "constrain", " ", "binds", " ", "only", " ", "for", " ", "the", " ", 
       "lowest", " ", "type"}], ")"}], " ", "and", " ", "another", " ", 
     RowBox[{"constrained", ".", " ", "We"}], " ", "determine", " ", "the", 
     " ", "two", " ", "cases", " ", "in", " ", 
     RowBox[{"turn", "."}]}]}]}], "*)"}]], "Input",
 CellChangeTimes->{{3.9235662561400676`*^9, 3.9235662909775867`*^9}, {
  3.9236275220792727`*^9, 3.9236275331830006`*^9}},
 CellLabel->
  "In[152]:=",ExpressionUUID->"97990813-c426-4785-81cb-342c2b69a24f"],

Cell[BoxData[
 RowBox[{"(*", 
  RowBox[{"Unconstrained", " ", "case"}], "*)"}]], "Input",
 CellChangeTimes->{{3.9235662999120903`*^9, 3.923566304335158*^9}},
 CellLabel->
  "In[153]:=",ExpressionUUID->"83f73557-0e57-40c2-af50-1f4d60de3892"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"Implementation", " ", "of", " ", "optimal", " ", "allocations"}], 
   "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{"u", "-", 
      RowBox[{
       RowBox[{
        RowBox[{"(", 
         RowBox[{"1", "-", "F"}], ")"}], "/", "f"}], " ", 
       RowBox[{"D", "[", 
        RowBox[{"u", ",", "\[Theta]"}], "]"}]}]}], "/.", 
     RowBox[{"q2", "\[Rule]", "0"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"q1E", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{
         RowBox[{"D", "[", 
          RowBox[{"%", ",", "q1"}], "]"}], "\[Equal]", "0"}], ",", "q1"}], 
       "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"u", "-", 
      RowBox[{"a1", " ", "q1"}], "-", 
      RowBox[{"a2", " ", 
       RowBox[{"q1", "^", "2"}]}]}], "/.", 
     RowBox[{"q2", "\[Rule]", "0"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"q1Eind", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{
         RowBox[{"D", "[", 
          RowBox[{"%", ",", "q1"}], "]"}], "\[Equal]", "0"}], ",", "q1"}], 
       "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.8865674202622237`*^9, 3.8865675119260645`*^9}, {
  3.886567547624389*^9, 3.8865675571796894`*^9}, {3.923566124826915*^9, 
  3.9235661569111176`*^9}},
 CellLabel->
  "In[154]:=",ExpressionUUID->"d7161c45-5767-4804-98b4-381a1b004555"],

Cell[BoxData[
 RowBox[{"1", "-", "d", "+", 
  RowBox[{"2", " ", "\[Theta]"}]}]], "Output",
 CellChangeTimes->{3.886567501159045*^9, 3.886567558029051*^9, 
  3.8866568014743624`*^9, 3.8877709969590073`*^9, 3.8879925643165436`*^9, 
  3.8881451158887577`*^9, 3.888303770552916*^9, 3.8916612367901573`*^9, 
  3.9224990714532413`*^9, 3.923566157422077*^9, 3.9235663140015507`*^9, 
  3.9236274820575113`*^9, 3.924583037460738*^9, 3.926392625033103*^9, 
  3.926998376089684*^9, 3.9270856121938753`*^9},
 CellLabel->
  "Out[155]=",ExpressionUUID->"c4dac62d-af64-4c83-bf4f-79c9bc4c5d05"],

Cell[BoxData[
 FractionBox[
  RowBox[{"1", "-", "a1", "+", "\[Theta]"}], 
  RowBox[{"1", "+", 
   RowBox[{"2", " ", "a2"}]}]]], "Output",
 CellChangeTimes->{3.886567501159045*^9, 3.886567558029051*^9, 
  3.8866568014743624`*^9, 3.8877709969590073`*^9, 3.8879925643165436`*^9, 
  3.8881451158887577`*^9, 3.888303770552916*^9, 3.8916612367901573`*^9, 
  3.9224990714532413`*^9, 3.923566157422077*^9, 3.9235663140015507`*^9, 
  3.9236274820575113`*^9, 3.924583037460738*^9, 3.926392625033103*^9, 
  3.926998376089684*^9, 3.9270856122058315`*^9},
 CellLabel->
  "Out[157]=",ExpressionUUID->"e1339409-abc7-4254-9703-04e778c5fda0"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"q1Eind", "-", "q1E"}], "/.", 
   RowBox[{"\[Theta]", "\[Rule]", "0"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"q1Eind", "-", "q1E", "-", 
    RowBox[{"(", "%", ")"}]}], "/.", 
   RowBox[{"\[Theta]", "\[Rule]", "1"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"{", 
   RowBox[{
    RowBox[{"%", "\[Equal]", "0"}], ",", 
    RowBox[{"%%", "\[Equal]", "0"}]}], "}"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"contrEunconstr", "=", 
  RowBox[{
   RowBox[{"FullSimplify", "[", 
    RowBox[{"Solve", "[", 
     RowBox[{"%", ",", 
      RowBox[{"{", 
       RowBox[{"a1", ",", "a2"}], "}"}]}], "]"}], "]"}], "[", 
   RowBox[{"[", "1", "]"}], "]"}]}]}], "Input",
 CellChangeTimes->{{3.886567564151306*^9, 3.886567580023155*^9}, {
  3.8865676568421135`*^9, 3.886567671098519*^9}},
 CellLabel->
  "In[158]:=",ExpressionUUID->"1c9c58b4-137d-49ec-a236-a399609d6afc"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"a1", "\[Rule]", 
    FractionBox[
     RowBox[{"1", "+", "d"}], "2"]}], ",", 
   RowBox[{"a2", "\[Rule]", 
    RowBox[{"-", 
     FractionBox["1", "4"]}]}]}], "}"}]], "Output",
 CellChangeTimes->{{3.8865676649086533`*^9, 3.886567672532241*^9}, 
   3.886656801640029*^9, 3.887770997432279*^9, 3.887992564438912*^9, 
   3.888145116041829*^9, 3.888303770775793*^9, 3.8916612368289223`*^9, 
   3.922499071500122*^9, 3.9235663156095924`*^9, 3.9236274965631747`*^9, 
   3.9245830374786634`*^9, 3.9263926274079475`*^9, 3.926998379657337*^9, 
   3.927085612269618*^9},
 CellLabel->
  "Out[161]=",ExpressionUUID->"4bee638b-8437-4f89-8f2d-b1a361a8e4e2"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"Determining", " ", "the", " ", "fixed", " ", 
    RowBox[{"fee", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"u", "-", 
       RowBox[{"a1", " ", "q1"}], "-", 
       RowBox[{"a2", " ", 
        RowBox[{"q1", "^", "2"}]}], "-", "k"}], "/.", 
      RowBox[{"q2", "\[Rule]", "0"}]}], "/.", 
     RowBox[{"q1", "\[Rule]", "q1E"}]}], "/.", "contrEunconstr"}], 
   "\[IndentingNewLine]", 
   RowBox[{"VR", ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"%", "-", "%%"}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", 
      RowBox[{"-", "d"}]}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"KEunconstr", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{"%", "\[Equal]", "0"}], ",", "k"}], "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.8865678390619345`*^9, 3.8865678624340057`*^9}, {
   3.8865679047953863`*^9, 3.886568015912733*^9}, {3.886578851818136*^9, 
   3.8865788687494907`*^9}, {3.923566357362918*^9, 3.9235663641421413`*^9}, 
   3.926392712620117*^9, 3.927087534209925*^9},
 CellLabel->
  "In[443]:=",ExpressionUUID->"70a8e45f-ca84-4700-8f6e-1a69961bbead"],

Cell[BoxData[
 RowBox[{
  RowBox[{"-", "k"}], "-", 
  RowBox[{
   FractionBox["1", "2"], " ", 
   RowBox[{"(", 
    RowBox[{"1", "+", "d"}], ")"}], " ", 
   RowBox[{"(", 
    RowBox[{"1", "-", "d", "+", 
     RowBox[{"2", " ", "\[Theta]"}]}], ")"}]}], "+", 
  RowBox[{
   RowBox[{"(", 
    RowBox[{"1", "+", "\[Theta]"}], ")"}], " ", 
   RowBox[{"(", 
    RowBox[{"1", "-", "d", "+", 
     RowBox[{"2", " ", "\[Theta]"}]}], ")"}]}], "-", 
  RowBox[{
   FractionBox["1", "4"], " ", 
   SuperscriptBox[
    RowBox[{"(", 
     RowBox[{"1", "-", "d", "+", 
      RowBox[{"2", " ", "\[Theta]"}]}], ")"}], "2"]}]}]], "Output",
 CellChangeTimes->{{3.8865679990442457`*^9, 3.886568018110202*^9}, 
   3.8865788692974863`*^9, 3.8866568019103055`*^9, 3.887770998163511*^9, 
   3.887992564639488*^9, 3.888145116298713*^9, 3.8883037711243296`*^9, 
   3.891661236954053*^9, 3.922499071597704*^9, 3.923566372801132*^9, 
   3.923627537467188*^9, 3.924583037494269*^9, 3.9263926304103394`*^9, 
   3.9263927140863047`*^9, 3.9269984324799895`*^9, 3.9270856123264327`*^9, 
   3.9270875347085376`*^9},
 CellLabel->
  "Out[443]=",ExpressionUUID->"5052d24d-e308-45df-8e23-bec967935dd0"],

Cell[BoxData[
 RowBox[{
  FractionBox["1", "4"], " ", 
  RowBox[{"(", 
   RowBox[{
    RowBox[{"-", "1"}], "-", 
    RowBox[{"2", " ", 
     SuperscriptBox["c", "2"]}], "-", 
    RowBox[{"4", " ", "c", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "d"}], ")"}]}], "+", 
    RowBox[{"d", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "2"}], "+", 
       RowBox[{"7", " ", "d"}]}], ")"}]}]}], ")"}]}]], "Output",
 CellChangeTimes->{{3.8865679990442457`*^9, 3.886568018110202*^9}, 
   3.8865788692974863`*^9, 3.8866568019103055`*^9, 3.887770998163511*^9, 
   3.887992564639488*^9, 3.888145116298713*^9, 3.8883037711243296`*^9, 
   3.891661236954053*^9, 3.922499071597704*^9, 3.923566372801132*^9, 
   3.923627537467188*^9, 3.924583037494269*^9, 3.9263926304103394`*^9, 
   3.9263927140863047`*^9, 3.9269984324799895`*^9, 3.9270856123264327`*^9, 
   3.9270875347683754`*^9},
 CellLabel->
  "Out[446]=",ExpressionUUID->"7bd158ff-a5bb-4fe4-b225-3a0b42432c57"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"FullSimplify", "[", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"a1", " ", "q1"}], "+", 
        RowBox[{"a2", " ", 
         RowBox[{"q1", "^", "2"}]}], "+", "k"}], "/.", 
       RowBox[{"q2", "\[Rule]", "0"}]}], "/.", 
      RowBox[{"q1", "\[Rule]", "q1E"}]}], "/.", "contrEunconstr"}], "/.", 
    RowBox[{"k", "->", "KEunconstr"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Integrate", "[", 
   RowBox[{
    RowBox[{"%", " ", "f"}], ",", 
    RowBox[{"{", 
     RowBox[{"\[Theta]", ",", 
      RowBox[{"-", "d"}], ",", "d"}], "}"}]}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"ProfitEunconstr", "=", 
  RowBox[{"FullSimplify", "[", "%", "]"}]}]}], "Input",
 CellChangeTimes->{{3.8865680275740323`*^9, 3.8865680864950485`*^9}, {
  3.926392731522021*^9, 3.9263927359451313`*^9}},
 CellLabel->
  "In[449]:=",ExpressionUUID->"5660586e-ba82-439d-ab59-7d427de0c3b3"],

Cell[BoxData[
 RowBox[{"c", "-", 
  FractionBox[
   SuperscriptBox["c", "2"], "2"], "-", 
  RowBox[{"c", " ", "d"}], "+", 
  FractionBox[
   RowBox[{"2", " ", 
    SuperscriptBox["d", "2"]}], "3"]}]], "Output",
 CellChangeTimes->{{3.886568058565402*^9, 3.88656808823559*^9}, 
   3.886578873512043*^9, 3.886656802002021*^9, 3.88777099839578*^9, 
   3.887992564724066*^9, 3.8881451165216503`*^9, 3.888303771296509*^9, 
   3.891661237047963*^9, 3.922499071668799*^9, 3.923566381331381*^9, 
   3.9236275408333273`*^9, 3.924583037541155*^9, 3.9263926355301304`*^9, {
   3.9263927248286023`*^9, 3.926392736517151*^9}, 3.927085612448041*^9, 
   3.927087570478582*^9},
 CellLabel->
  "Out[451]=",ExpressionUUID->"88c79584-b540-480f-818c-e5569e0e29e1"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"Firm", " ", "2", " ", "under", " ", 
    RowBox[{"exclusivity", ".", " ", "Implementation"}], " ", "of", " ", 
    "optimal", " ", "allocations"}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{"u", "-", 
      RowBox[{"c", " ", "q2"}], "-", 
      RowBox[{
       RowBox[{
        RowBox[{"(", 
         RowBox[{"1", "-", "F"}], ")"}], "/", "f"}], " ", 
       RowBox[{"D", "[", 
        RowBox[{"u", ",", "\[Theta]"}], "]"}]}]}], "/.", 
     RowBox[{"q1", "\[Rule]", "0"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"q2E", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{
         RowBox[{"D", "[", 
          RowBox[{"%", ",", "q2"}], "]"}], "\[Equal]", "0"}], ",", "q2"}], 
       "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"u", "-", 
      RowBox[{"b1", " ", "q2"}], "-", 
      RowBox[{"b2", " ", 
       RowBox[{"q2", "^", "2"}]}]}], "/.", 
     RowBox[{"q1", "\[Rule]", "0"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"q2Eind", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{
         RowBox[{"D", "[", 
          RowBox[{"%", ",", "q2"}], "]"}], "\[Equal]", "0"}], ",", "q2"}], 
       "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.926998567680035*^9, 3.9269985970281353`*^9}, {
  3.9269986740733957`*^9, 3.926998686839047*^9}, {3.9269987618706336`*^9, 
  3.926998761943392*^9}, {3.927085367563526*^9, 3.92708537233749*^9}},
 CellLabel->
  "In[169]:=",ExpressionUUID->"b56e38b0-c786-4a44-81a0-60051a7ef294"],

Cell[BoxData[
 RowBox[{"1", "-", "c", "-", "d", "+", 
  RowBox[{"2", " ", "\[Theta]"}]}]], "Output",
 CellChangeTimes->{3.926998691834135*^9, 3.926998762985764*^9, 
  3.9270856125317435`*^9},
 CellLabel->
  "Out[170]=",ExpressionUUID->"bbcd31ea-b5ab-4aa6-a501-b1110a97ca21"],

Cell[BoxData[
 FractionBox[
  RowBox[{"1", "-", "b1", "+", "\[Theta]"}], 
  RowBox[{"1", "+", 
   RowBox[{"2", " ", "b2"}]}]]], "Output",
 CellChangeTimes->{3.926998691834135*^9, 3.926998762985764*^9, 
  3.9270856125828676`*^9},
 CellLabel->
  "Out[172]=",ExpressionUUID->"68bb0eb3-fa0e-45b8-a31d-8b8b966ab858"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"q2Eind", "-", "q2E"}], "/.", 
   RowBox[{"\[Theta]", "\[Rule]", "0"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"q2Eind", "-", "q2E", "-", 
    RowBox[{"(", "%", ")"}]}], "/.", 
   RowBox[{"\[Theta]", "\[Rule]", "1"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"FullSimplify", "[", 
  RowBox[{"{", 
   RowBox[{
    RowBox[{"%", "\[Equal]", "0"}], ",", 
    RowBox[{"%%", "\[Equal]", "0"}]}], "}"}], "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"FullSimplify", "[", 
   RowBox[{"Solve", "[", 
    RowBox[{"%", ",", 
     RowBox[{"{", 
      RowBox[{"b1", ",", "b2"}], "}"}]}], "]"}], "]"}], "[", 
  RowBox[{"[", "1", "]"}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"U2extmp", "=", 
  RowBox[{"FullSimplify", "[", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"u", "-", 
       RowBox[{"b1", " ", "q2"}], "-", 
       RowBox[{"b2", " ", 
        RowBox[{"q2", "^", "2"}]}], "-", "F2"}], "/.", 
      RowBox[{"q1", "\[Rule]", "0"}]}], "/.", 
     RowBox[{"q2", "\[Rule]", "q2E"}]}], "/.", "%"}], 
   "]"}]}], "\[IndentingNewLine]", "VR", "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"%", "-", "%%"}], "/.", 
   RowBox[{"\[Theta]", "\[Rule]", 
    RowBox[{"-", "d"}]}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"F2tmp", "=", 
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{"Solve", "[", 
      RowBox[{
       RowBox[{"%", "\[Equal]", "0"}], ",", "F2"}], "]"}], "]"}], "[", 
    RowBox[{"[", 
     RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{"FullSimplify", "[", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"b1", " ", "q2"}], "+", 
       RowBox[{"b2", " ", 
        RowBox[{"q2", "^", "2"}]}], "-", 
       RowBox[{"c", " ", "q2"}], "+", "F2"}], "/.", 
      RowBox[{"q1", "\[Rule]", "0"}]}], "/.", 
     RowBox[{"q2", "\[Rule]", "q2Eind"}]}], "/.", "%%%%%"}], "/.", 
   RowBox[{"F2", "\[Rule]", "%"}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Integrate", "[", 
   RowBox[{
    RowBox[{"%", " ", "f"}], ",", 
    RowBox[{"{", 
     RowBox[{"\[Theta]", ",", 
      RowBox[{"-", "d"}], ",", "d"}], "}"}]}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"FullSimplify", "[", "%", "]"}]}], "Input",
 CellChangeTimes->{{3.9269987074128666`*^9, 3.9269987447599287`*^9}, {
  3.9269987845845346`*^9, 3.9269989841602974`*^9}, {3.9269990392627387`*^9, 
  3.9269990582366805`*^9}, {3.9269991300316305`*^9, 3.9269991570505753`*^9}, {
  3.926999190903796*^9, 3.9269991919552913`*^9}, {3.9269994208602257`*^9, 
  3.9269994520268908`*^9}},
 CellLabel->
  "In[412]:=",ExpressionUUID->"640bcca1-c499-4c81-9893-bca850cc548e"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{
    RowBox[{"2", "+", 
     FractionBox["1", 
      RowBox[{
       RowBox[{"-", "1"}], "-", 
       RowBox[{"2", " ", "b2"}]}]]}], "\[Equal]", "0"}], ",", 
   RowBox[{
    RowBox[{
     FractionBox[
      RowBox[{"1", "-", "b1"}], 
      RowBox[{"1", "+", 
       RowBox[{"2", " ", "b2"}]}]], "+", "c", "+", "d"}], "\[Equal]", "1"}]}],
   "}"}]], "Output",
 CellChangeTimes->{{3.9269987202334867`*^9, 3.9269987657343073`*^9}, 
   3.926998869229901*^9, {3.9269989241512527`*^9, 3.926998956028116*^9}, 
   3.9269990401207676`*^9, {3.9269991306581874`*^9, 3.926999157896445*^9}, 
   3.926999194487787*^9, {3.9269994217090216`*^9, 3.9269994528940115`*^9}, 
   3.9270856128025427`*^9, 3.9270871432512836`*^9},
 CellLabel->
  "Out[414]=",ExpressionUUID->"41608e1c-5b7e-44c0-ae5e-559b55f19a7e"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"b1", "\[Rule]", 
    RowBox[{
     FractionBox["1", "2"], " ", 
     RowBox[{"(", 
      RowBox[{"1", "+", "c", "+", "d"}], ")"}]}]}], ",", 
   RowBox[{"b2", "\[Rule]", 
    RowBox[{"-", 
     FractionBox["1", "4"]}]}]}], "}"}]], "Output",
 CellChangeTimes->{{3.9269987202334867`*^9, 3.9269987657343073`*^9}, 
   3.926998869229901*^9, {3.9269989241512527`*^9, 3.926998956028116*^9}, 
   3.9269990401207676`*^9, {3.9269991306581874`*^9, 3.926999157896445*^9}, 
   3.926999194487787*^9, {3.9269994217090216`*^9, 3.9269994528940115`*^9}, 
   3.9270856128025427`*^9, 3.9270871432563314`*^9},
 CellLabel->
  "Out[415]=",ExpressionUUID->"fe7258cf-0d05-466d-ba12-4fd3409b205a"],

Cell[BoxData[
 RowBox[{
  FractionBox["1", "4"], " ", 
  RowBox[{"(", 
   RowBox[{"1", "+", 
    SuperscriptBox["c", "2"], "-", 
    RowBox[{"2", " ", "d"}], "-", 
    RowBox[{"4", " ", "F2"}], "+", 
    RowBox[{"2", " ", "c", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "d", "-", 
       RowBox[{"2", " ", "\[Theta]"}]}], ")"}]}], "+", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{"d", "-", 
       RowBox[{"2", " ", "\[Theta]"}]}], ")"}], "2"], "+", 
    RowBox[{"4", " ", "\[Theta]"}]}], ")"}]}]], "Output",
 CellChangeTimes->{{3.9269987202334867`*^9, 3.9269987657343073`*^9}, 
   3.926998869229901*^9, {3.9269989241512527`*^9, 3.926998956028116*^9}, 
   3.9269990401207676`*^9, {3.9269991306581874`*^9, 3.926999157896445*^9}, 
   3.926999194487787*^9, {3.9269994217090216`*^9, 3.9269994528940115`*^9}, 
   3.9270856128025427`*^9, 3.9270871433333445`*^9},
 CellLabel->
  "Out[416]=",ExpressionUUID->"108674e6-d6e4-4c59-b9b1-af9b8a41abb7"],

Cell[BoxData[
 RowBox[{
  FractionBox["1", "2"], " ", 
  SuperscriptBox[
   RowBox[{"(", 
    RowBox[{"1", "-", "c", "+", "\[Theta]"}], ")"}], "2"]}]], "Output",
 CellChangeTimes->{{3.9269987202334867`*^9, 3.9269987657343073`*^9}, 
   3.926998869229901*^9, {3.9269989241512527`*^9, 3.926998956028116*^9}, 
   3.9269990401207676`*^9, {3.9269991306581874`*^9, 3.926999157896445*^9}, 
   3.926999194487787*^9, {3.9269994217090216`*^9, 3.9269994528940115`*^9}, 
   3.9270856128025427`*^9, 3.927087143336336*^9},
 CellLabel->
  "Out[417]=",ExpressionUUID->"cdc7adb3-4e5c-469e-9ee1-3bfb91cfcb74"],

Cell[BoxData[
 RowBox[{
  FractionBox["1", "4"], " ", 
  RowBox[{"(", 
   RowBox[{
    RowBox[{"-", 
     SuperscriptBox[
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "1"}], "+", "c"}], ")"}], "2"]}], "+", 
    RowBox[{"2", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "c"}], ")"}], " ", "d"}], "+", 
    RowBox[{"7", " ", 
     SuperscriptBox["d", "2"]}]}], ")"}]}]], "Output",
 CellChangeTimes->{{3.9269987202334867`*^9, 3.9269987657343073`*^9}, 
   3.926998869229901*^9, {3.9269989241512527`*^9, 3.926998956028116*^9}, 
   3.9269990401207676`*^9, {3.9269991306581874`*^9, 3.926999157896445*^9}, 
   3.926999194487787*^9, {3.9269994217090216`*^9, 3.9269994528940115`*^9}, 
   3.9270856128025427`*^9, 3.927087143392533*^9},
 CellLabel->
  "Out[419]=",ExpressionUUID->"100f5ddd-d09b-4fe5-a1fe-75cc18c5276c"],

Cell[BoxData[
 RowBox[{
  SuperscriptBox["d", "2"], "+", 
  RowBox[{"2", " ", "d", " ", "\[Theta]"}], "-", 
  SuperscriptBox["\[Theta]", "2"]}]], "Output",
 CellChangeTimes->{{3.9269987202334867`*^9, 3.9269987657343073`*^9}, 
   3.926998869229901*^9, {3.9269989241512527`*^9, 3.926998956028116*^9}, 
   3.9269990401207676`*^9, {3.9269991306581874`*^9, 3.926999157896445*^9}, 
   3.926999194487787*^9, {3.9269994217090216`*^9, 3.9269994528940115`*^9}, 
   3.9270856128025427`*^9, 3.927087143395519*^9},
 CellLabel->
  "Out[420]=",ExpressionUUID->"8c6193eb-8c4b-45ff-a3da-224cea913953"],

Cell[BoxData[
 FractionBox[
  RowBox[{"2", " ", 
   SuperscriptBox["d", "2"]}], "3"]], "Output",
 CellChangeTimes->{{3.9269987202334867`*^9, 3.9269987657343073`*^9}, 
   3.926998869229901*^9, {3.9269989241512527`*^9, 3.926998956028116*^9}, 
   3.9269990401207676`*^9, {3.9269991306581874`*^9, 3.926999157896445*^9}, 
   3.926999194487787*^9, {3.9269994217090216`*^9, 3.9269994528940115`*^9}, 
   3.9270856128025427`*^9, 3.9270871433975167`*^9},
 CellLabel->
  "Out[422]=",ExpressionUUID->"cfac4a04-91b6-4914-8a29-290eb8ba0a03"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"Consmer", " ", 
    RowBox[{"surplus", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{"UEtype", "=", 
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{"u", "-", 
          RowBox[{"(", 
           RowBox[{
            RowBox[{"a1", " ", "q1"}], "+", 
            RowBox[{"a2", " ", 
             RowBox[{"q1", "^", "2"}]}], "+", "k"}], ")"}]}], "/.", 
         RowBox[{"q2", "\[Rule]", "0"}]}], "/.", 
        RowBox[{"q1", "\[Rule]", "q1E"}]}], "/.", "contrEunconstr"}], "/.", 
      RowBox[{"k", "->", "KEunconstr"}]}], "]"}]}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Integrate", "[", 
     RowBox[{
      RowBox[{"%", " ", "f"}], ",", 
      RowBox[{"{", 
       RowBox[{"\[Theta]", ",", 
        RowBox[{"-", "d"}], ",", "d"}], "}"}]}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"CSEunconstr", "=", 
    RowBox[{"FullSimplify", "[", "%", "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.8880442059773397`*^9, 3.8880442247048674`*^9}, {
  3.888314240905481*^9, 3.888314247627838*^9}, {3.923566396060272*^9, 
  3.9235664012456646`*^9}, {3.926392742670168*^9, 3.926392748677388*^9}},
 CellLabel->
  "In[423]:=",ExpressionUUID->"df90fc19-6bd3-4468-809a-7398b202ecae"],

Cell[BoxData[
 RowBox[{
  FractionBox["1", "8"], " ", 
  RowBox[{"(", 
   RowBox[{"3", "+", 
    RowBox[{"2", " ", 
     SuperscriptBox["c", "2"]}], "+", 
    RowBox[{"4", " ", "c", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "d"}], ")"}]}], "-", 
    RowBox[{"5", " ", 
     SuperscriptBox["d", "2"]}], "+", 
    RowBox[{"8", " ", "\[Theta]", " ", 
     RowBox[{"(", 
      RowBox[{"1", "+", "\[Theta]"}], ")"}]}], "-", 
    RowBox[{"2", " ", "d", " ", 
     RowBox[{"(", 
      RowBox[{"1", "+", 
       RowBox[{"4", " ", "\[Theta]"}]}], ")"}]}]}], ")"}]}]], "Output",
 CellChangeTimes->{3.8880442271808486`*^9, 3.8881451166006255`*^9, 
  3.888303771384002*^9, 3.8883142482801714`*^9, 3.8916612371017647`*^9, 
  3.9224990717000465`*^9, 3.923566401876546*^9, 3.9236275476248245`*^9, 
  3.9245830375764484`*^9, 3.926392637229048*^9, 3.9263927490843897`*^9, 
  3.927085613077175*^9, 3.927087150612379*^9},
 CellLabel->
  "Out[423]=",ExpressionUUID->"48b95674-9ea6-4751-ad77-8cad5f7a1837"],

Cell[BoxData[
 RowBox[{
  FractionBox["1", "24"], " ", 
  RowBox[{"(", 
   RowBox[{"9", "+", 
    RowBox[{"6", " ", 
     SuperscriptBox["c", "2"]}], "+", 
    RowBox[{"12", " ", "c", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "d"}], ")"}]}], "-", 
    RowBox[{"d", " ", 
     RowBox[{"(", 
      RowBox[{"6", "+", 
       RowBox[{"7", " ", "d"}]}], ")"}]}]}], ")"}]}]], "Output",
 CellChangeTimes->{3.8880442271808486`*^9, 3.8881451166006255`*^9, 
  3.888303771384002*^9, 3.8883142482801714`*^9, 3.8916612371017647`*^9, 
  3.9224990717000465`*^9, 3.923566401876546*^9, 3.9236275476248245`*^9, 
  3.9245830375764484`*^9, 3.926392637229048*^9, 3.9263927490843897`*^9, 
  3.927085613077175*^9, 3.927087150668192*^9},
 CellLabel->
  "Out[425]=",ExpressionUUID->"a67e8949-9495-4394-b08f-9cb349115835"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
    "The", " ", "switching", " ", "type", " ", "that", " ", "detemines", " ", 
     "the", " ", "two", " ", "cases", " ", "constrained", " ", "and", " ", 
     "unconstrained"}], ",", " ", 
    RowBox[{
    "and", " ", "the", " ", "threshold", " ", "value", " ", "for", " ", 
     RowBox[{"\[CapitalDelta]", ":"}]}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"q1E", "\[Equal]", "qe2"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"\[Theta]switchE", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{"%", ",", "\[Theta]"}], "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}], 
   "\[IndentingNewLine]", 
   RowBox[{"dExcl", "=", 
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{"\[Theta]switchE", "\[Equal]", 
         RowBox[{"-", "d"}]}], ",", "d"}], "]"}], "[", 
      RowBox[{"[", 
       RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.8865676867736793`*^9, 3.8865677546219597`*^9}, {
   3.886567790246787*^9, 3.8865678187723837`*^9}, {3.923566325460523*^9, 
   3.923566347482726*^9}, {3.923566422691658*^9, 3.9235664437474766`*^9}, 
   3.926392904684519*^9},
 CellLabel->
  "In[426]:=",ExpressionUUID->"64a40027-1f07-41e9-8248-c731f24c7928"],

Cell[BoxData[
 RowBox[{
  RowBox[{"-", "c"}], "+", "d"}]], "Output",
 CellChangeTimes->{{3.886567737538031*^9, 3.8865677555876665`*^9}, 
   3.8865678192696*^9, 3.8866568018215055`*^9, 3.8877709979017725`*^9, 
   3.8879925645704937`*^9, 3.8881451162034855`*^9, 3.8883037709472733`*^9, 
   3.891661236892296*^9, 3.922499071553218*^9, 3.9236275611647615`*^9, 
   3.92458303760768*^9, 3.92639264101173*^9, 3.926392852403723*^9, 
   3.9263929069697833`*^9, 3.9270856131551285`*^9, 3.927087153248548*^9},
 CellLabel->
  "Out[427]=",ExpressionUUID->"567be816-e1ac-43c9-b639-d478d19c5b4d"],

Cell[BoxData[
 FractionBox["c", "2"]], "Output",
 CellChangeTimes->{{3.886567737538031*^9, 3.8865677555876665`*^9}, 
   3.8865678192696*^9, 3.8866568018215055`*^9, 3.8877709979017725`*^9, 
   3.8879925645704937`*^9, 3.8881451162034855`*^9, 3.8883037709472733`*^9, 
   3.891661236892296*^9, 3.922499071553218*^9, 3.9236275611647615`*^9, 
   3.92458303760768*^9, 3.92639264101173*^9, 3.926392852403723*^9, 
   3.9263929069697833`*^9, 3.9270856131551285`*^9, 3.927087153256521*^9},
 CellLabel->
  "Out[428]=",ExpressionUUID->"90954e17-b809-4fa0-b9c6-c0d172b11126"]
}, Open  ]],

Cell[BoxData[
 RowBox[{"(*", 
  RowBox[{"Constrained", " ", "case"}], "*)"}]], "Input",
 CellChangeTimes->{{3.923566411995516*^9, 3.9235664170920987`*^9}},
 CellLabel->
  "In[190]:=",ExpressionUUID->"91d04813-b135-4eb6-9e4f-7121f7aa4a66"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"Profitto", " ", "di", " ", "esclusiva", " ", 
    RowBox[{"constrained", ".", " ", "Determining"}], " ", "the", " ", 
    "fixed", " ", 
    RowBox[{"fee", ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"a1", " ", "q1"}], "+", 
        RowBox[{"a2", " ", 
         RowBox[{"q1", "^", "2"}]}], "+", "k"}], "/.", 
       RowBox[{"q1", "\[Rule]", "q1E"}]}], "/.", "contrEunconstr"}], "/.", 
     RowBox[{"\[Theta]", "->", "\[Theta]switchE"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"a1", " ", "q1"}], "+", 
        RowBox[{"a2", " ", 
         RowBox[{"q1", "^", "2"}]}]}], "/.", 
       RowBox[{"q1", "\[Rule]", "qe2"}]}], "/.", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"a1", "\[Rule]", "c"}], ",", 
        RowBox[{"a2", "\[Rule]", "0"}]}], "}"}]}], "/.", 
     RowBox[{"\[Theta]", "->", "\[Theta]switchE"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"KEconstr", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{"%%", "\[Equal]", "%"}], ",", "k"}], "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.886568121249802*^9, 3.8865681273970575`*^9}, {
  3.886568164964326*^9, 3.886568250460074*^9}, {3.9235664548513517`*^9, 
  3.9235664626579113`*^9}, {3.9236276177419915`*^9, 3.9236276328153505`*^9}},
 CellLabel->
  "In[429]:=",ExpressionUUID->"f2151af7-bafd-4506-be1f-1db0dc8f3e7a"],

Cell[BoxData[
 RowBox[{
  RowBox[{"-", 
   FractionBox["1", "4"]}], " ", 
  SuperscriptBox[
   RowBox[{"(", 
    RowBox[{"1", "-", 
     RowBox[{"2", " ", "c"}], "+", "d"}], ")"}], "2"]}]], "Output",
 CellChangeTimes->{{3.8865682321552753`*^9, 3.8865682507827187`*^9}, 
   3.886578876969322*^9, 3.8866568020937796`*^9, 3.8877709986113024`*^9, 
   3.887992564786555*^9, 3.8881451167551203`*^9, 3.8883037715553226`*^9, 
   3.8916612371964912`*^9, 3.92249907180037*^9, 3.9235664630737796`*^9, 
   3.923627640128255*^9, 3.924583037623293*^9, 3.9263926444283876`*^9, 
   3.9263929224485154`*^9, 3.927085613263764*^9, 3.9270871564374013`*^9},
 CellLabel->
  "Out[431]=",ExpressionUUID->"c9a13fe2-a12e-4088-b4d2-c61e0025c91f"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"The", " ", "two", " ", "cases", " ", "combined"}], ",", " ", 
    RowBox[{"depnding", " ", "on", " ", "types", " ", 
     RowBox[{"\[Theta]", ":"}]}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"Line", "[", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"\[Theta]switchE", ",", "0"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"\[Theta]switchE", ",", "1"}], "}"}]}], "}"}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"1", "-", "d"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"1", "+", "d"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{"qe2", "/.", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"a1", "\[Rule]", "c"}], ",", 
         RowBox[{"a2", "\[Rule]", "0"}]}], "}"}]}], "/.", 
      RowBox[{"k", "\[Rule]", "0"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{"q1E", "/.", "contrEunconstr"}], "/.", 
      RowBox[{"k", "->", "KEconstr"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"Manipulate", "[", 
    RowBox[{
     RowBox[{"Plot", "[", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"%", ",", "%%"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"\[Theta]", ",", "%%%%", ",", "%%%"}], "}"}], ",", 
       RowBox[{"Epilog", "\[Rule]", 
        RowBox[{"{", "%%%%%", "}"}]}]}], "]"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"c", ",", "0.1"}], "}"}], ",", "0", ",", 
       RowBox[{"1", "/", "2"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"d", ",", "0.1"}], "}"}], ",", "0", ",", "1"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"\[Gamma]", ",", "0.3"}], "}"}], ",", "0", ",", "1"}], 
      "}"}]}], "]"}]}]}]], "Input",
 CellChangeTimes->{{3.886575402349094*^9, 3.8865754078090343`*^9}, {
  3.9235664934810057`*^9, 3.9235665116280704`*^9}},
 CellLabel->
  "In[194]:=",ExpressionUUID->"24e7749c-b803-4d44-aa6d-63f4a21a96fe"],

Cell[BoxData[
 TagBox[
  StyleBox[
   DynamicModuleBox[{$CellContext`c$$ = 0.1, $CellContext`d$$ = 
    0.1, $CellContext`\[Gamma]$$ = 0.3, Typeset`show$$ = True, 
    Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", 
    Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = 
    "\"untitled\"", Typeset`specs$$ = {{{
       Hold[$CellContext`c$$], 0.1}, 0, 
      Rational[1, 2]}, {{
       Hold[$CellContext`d$$], 0.1}, 0, 1}, {{
       Hold[$CellContext`\[Gamma]$$], 0.3}, 0, 1}}, Typeset`size$$ = {
    360., {107., 111.81441188891387`}}, Typeset`update$$ = 0, 
    Typeset`initDone$$, Typeset`skipInitDone$$ = True}, 
    DynamicBox[Manipulate`ManipulateBoxes[
     1, StandardForm, 
      "Variables" :> {$CellContext`c$$ = 0.1, $CellContext`d$$ = 
        0.1, $CellContext`\[Gamma]$$ = 0.3}, "ControllerVariables" :> {}, 
      "OtherVariables" :> {
       Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, 
        Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, 
        Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$,
         Typeset`skipInitDone$$}, "Body" :> 
      Plot[{1 - $CellContext`d$$ + 2 $CellContext`\[Theta], 
         1 - $CellContext`c$$ + $CellContext`\[Theta]}, \
{$CellContext`\[Theta], 1 - $CellContext`d$$, 1 + $CellContext`d$$}, Epilog -> {
          
          Line[{{-$CellContext`c$$ + $CellContext`d$$, 
             0}, {-$CellContext`c$$ + $CellContext`d$$, 1}}]}], 
      "Specifications" :> {{{$CellContext`c$$, 0.1}, 0, 
         Rational[1, 2]}, {{$CellContext`d$$, 0.1}, 0, 
         1}, {{$CellContext`\[Gamma]$$, 0.3}, 0, 1}}, "Options" :> {}, 
      "DefaultOptions" :> {}],
     ImageSizeCache->{817., {136., 142.}},
     SingleEvaluation->True],
    Deinitialization:>None,
    DynamicModuleValues:>{},
    SynchronousInitialization->True,
    UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$},
    UnsavedVariables:>{Typeset`initDone$$},
    UntrackedVariables:>{Typeset`size$$}], "Manipulate",
   Deployed->True,
   StripOnInput->False],
  Manipulate`InterpretManipulate[1]]], "Output",
 CellChangeTimes->{3.886575408463845*^9, 3.886656802513921*^9, 
  3.8877709997350416`*^9, 3.8879925650560904`*^9, 3.8881451172220163`*^9, 
  3.8883037721278777`*^9, 3.8916612374148283`*^9, 3.9224990719319296`*^9, 
  3.9235665179558597`*^9, 3.923627644220976*^9, 3.924583037654539*^9, 
  3.927085613357463*^9},
 CellLabel->
  "Out[199]=",ExpressionUUID->"bc16a0c9-97cd-418a-9fbd-3bababbe7a99"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"Line", "[", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"\[Theta]switchE", ",", "0"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"\[Theta]switchE", ",", "1"}], "}"}]}], "}"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"1", "-", "d"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"1", "+", "d"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"FullSimplify", "[", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"u", "-", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{"a1", " ", "q1"}], "+", 
          RowBox[{"a2", " ", 
           RowBox[{"q1", "^", "2"}]}], "+", "k"}], ")"}]}], "/.", 
       RowBox[{"q2", "\[Rule]", "0"}]}], "/.", 
      RowBox[{"q1", "\[Rule]", "qe2"}]}], "/.", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"a1", "\[Rule]", "c"}], ",", 
       RowBox[{"a2", "\[Rule]", "0"}]}], "}"}]}], "/.", 
    RowBox[{"k", "\[Rule]", "0"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"FullSimplify", "[", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"u", "-", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{"a1", " ", "q1"}], "+", 
          RowBox[{"a2", " ", 
           RowBox[{"q1", "^", "2"}]}], "+", "k"}], ")"}]}], "/.", 
       RowBox[{"q2", "\[Rule]", "0"}]}], "/.", 
      RowBox[{"q1", "\[Rule]", "q1E"}]}], "/.", "contrEunconstr"}], "/.", 
    RowBox[{"k", "->", "KEconstr"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"Manipulate", "[", 
  RowBox[{
   RowBox[{"Plot", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"%", ",", "%%"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"\[Theta]", ",", "%%%%", ",", "%%%"}], "}"}], ",", 
     RowBox[{"Epilog", "\[Rule]", 
      RowBox[{"{", "%%%%%", "}"}]}]}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"c", ",", "0.1"}], "}"}], ",", "0", ",", 
     RowBox[{"1", "/", "2"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"d", ",", "0.1"}], "}"}], ",", "0", ",", "1"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"\[Gamma]", ",", "0.3"}], "}"}], ",", "0", ",", "1"}], "}"}]}], 
  "]"}]}], "Input",
 CellChangeTimes->{{3.8865754629148073`*^9, 3.8865754728360085`*^9}},
 CellLabel->
  "In[200]:=",ExpressionUUID->"96af27bc-5191-4f71-88fc-9cec31cc8955"],

Cell[BoxData[
 TagBox[
  StyleBox[
   DynamicModuleBox[{$CellContext`c$$ = 0.1, $CellContext`d$$ = 
    0.1, $CellContext`\[Gamma]$$ = 0.3, Typeset`show$$ = True, 
    Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", 
    Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = 
    "\"untitled\"", Typeset`specs$$ = {{{
       Hold[$CellContext`c$$], 0.1}, 0, 
      Rational[1, 2]}, {{
       Hold[$CellContext`d$$], 0.1}, 0, 1}, {{
       Hold[$CellContext`\[Gamma]$$], 0.3}, 0, 1}}, Typeset`size$$ = {
    360., {107., 111.81441188891392`}}, Typeset`update$$ = 0, 
    Typeset`initDone$$, Typeset`skipInitDone$$ = True}, 
    DynamicBox[Manipulate`ManipulateBoxes[
     1, StandardForm, 
      "Variables" :> {$CellContext`c$$ = 0.1, $CellContext`d$$ = 
        0.1, $CellContext`\[Gamma]$$ = 0.3}, "ControllerVariables" :> {}, 
      "OtherVariables" :> {
       Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, 
        Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, 
        Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$,
         Typeset`skipInitDone$$}, "Body" :> 
      Plot[{Rational[1, 2] + $CellContext`c$$^2 + 
         Rational[1, 2] $CellContext`d$$^2 - $CellContext`c$$ (
          1 + $CellContext`d$$) + $CellContext`\[Theta] - $CellContext`d$$ \
$CellContext`\[Theta] + $CellContext`\[Theta]^2, 
         Rational[
          1, 2] (1 - $CellContext`c$$ + $CellContext`\[Theta])^2}, \
{$CellContext`\[Theta], 1 - $CellContext`d$$, 1 + $CellContext`d$$}, Epilog -> {
          
          Line[{{-$CellContext`c$$ + $CellContext`d$$, 
             0}, {-$CellContext`c$$ + $CellContext`d$$, 1}}]}], 
      "Specifications" :> {{{$CellContext`c$$, 0.1}, 0, 
         Rational[1, 2]}, {{$CellContext`d$$, 0.1}, 0, 
         1}, {{$CellContext`\[Gamma]$$, 0.3}, 0, 1}}, "Options" :> {}, 
      "DefaultOptions" :> {}],
     ImageSizeCache->{817., {136., 142.}},
     SingleEvaluation->True],
    Deinitialization:>None,
    DynamicModuleValues:>{},
    SynchronousInitialization->True,
    UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$},
    UnsavedVariables:>{Typeset`initDone$$},
    UntrackedVariables:>{Typeset`size$$}], "Manipulate",
   Deployed->True,
   StripOnInput->False],
  Manipulate`InterpretManipulate[1]]], "Output",
 CellChangeTimes->{3.886575474006531*^9, 3.886578909997836*^9, 
  3.8866568026116323`*^9, 3.8877710001705256`*^9, 3.8879925651185713`*^9, 
  3.8881451173619366`*^9, 3.8883037722187443`*^9, 3.891661237514516*^9, 
  3.9224990719854155`*^9, 3.923566537309391*^9, 3.923627659762266*^9, 
  3.9245830376767406`*^9, 3.9270856134822407`*^9},
 CellLabel->
  "Out[205]=",ExpressionUUID->"08d3b348-d647-41d6-9e54-9c51720116f6"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
    "Detmining", " ", "the", " ", "profit", " ", "of", " ", "firm", " ", 
     "1"}], ":"}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{
          RowBox[{"a1", " ", "q1"}], "+", 
          RowBox[{"a2", " ", 
           RowBox[{"q1", "^", "2"}]}], "+", "k"}], "/.", 
         RowBox[{"q2", "\[Rule]", "0"}]}], "/.", 
        RowBox[{"q1", "\[Rule]", "qe2"}]}], "/.", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"a1", "\[Rule]", "c"}], ",", 
         RowBox[{"a2", "\[Rule]", "0"}]}], "}"}]}], "/.", 
      RowBox[{"k", "\[Rule]", "0"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Integrate", "[", 
     RowBox[{
      RowBox[{"%", " ", "f"}], ",", 
      RowBox[{"{", 
       RowBox[{"\[Theta]", ",", 
        RowBox[{"-", "d"}], ",", "\[Theta]switchE"}], "}"}]}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{
          RowBox[{"a1", " ", "q1"}], "+", 
          RowBox[{"a2", " ", 
           RowBox[{"q1", "^", "2"}]}], "+", "k"}], "/.", 
         RowBox[{"q2", "\[Rule]", "0"}]}], "/.", 
        RowBox[{"q1", "\[Rule]", "q1E"}]}], "/.", "contrEunconstr"}], "/.", 
      RowBox[{"k", "->", "KEconstr"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Integrate", "[", 
     RowBox[{
      RowBox[{"%", " ", "f"}], ",", 
      RowBox[{"{", 
       RowBox[{"\[Theta]", ",", "\[Theta]switchE", ",", "d"}], "}"}]}], "]"}],
     ";"}], "\[IndentingNewLine]", 
   RowBox[{"ProfitEconstr", "=", 
    RowBox[{"FullSimplify", "[", 
     RowBox[{"%", "+", "%%%"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.886568270727316*^9, 3.886568335821004*^9}, {
  3.9235665698328204`*^9, 3.9235665824199076`*^9}, {3.926392964482753*^9, 
  3.9263929933796115`*^9}},
 CellLabel->
  "In[432]:=",ExpressionUUID->"41b75b1f-4b58-4de8-ae6d-813d7aeb47d2"],

Cell[BoxData[
 RowBox[{"c", "-", 
  SuperscriptBox["c", "2"], "+", 
  FractionBox[
   SuperscriptBox["c", "3"], 
   RowBox[{"12", " ", "d"}]]}]], "Output",
 CellChangeTimes->{3.8865683394548407`*^9, 3.8865750792803698`*^9, 
  3.886578981163103*^9, 3.8866568029247613`*^9, 3.887771000654167*^9, 
  3.887992565256562*^9, 3.888145117614834*^9, 3.8883037723928804`*^9, 
  3.891661237704115*^9, 3.922499072054415*^9, 3.923566583713049*^9, 
  3.923627679574811*^9, 3.9245830377445145`*^9, 3.926392650459263*^9, 
  3.9263929941863823`*^9, 3.9270856137254286`*^9, 3.9270871646313734`*^9},
 CellLabel->
  "Out[436]=",ExpressionUUID->"df46f188-08a5-45fb-ab4c-5bff1ec61104"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
   "The", " ", "consumer", " ", "surplus", " ", "in", " ", "the", " ", 
    "constrained", " ", "case"}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{"u", "-", 
          RowBox[{"(", 
           RowBox[{
            RowBox[{"a1", " ", "q1"}], "+", 
            RowBox[{"a2", " ", 
             RowBox[{"q1", "^", "2"}]}], "+", "k"}], ")"}]}], "/.", 
         RowBox[{"q2", "\[Rule]", "0"}]}], "/.", 
        RowBox[{"q1", "\[Rule]", "qe2"}]}], "/.", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"a1", "\[Rule]", "c"}], ",", 
         RowBox[{"a2", "\[Rule]", "0"}]}], "}"}]}], "/.", 
      RowBox[{"k", "\[Rule]", "0"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Integrate", "[", 
     RowBox[{
      RowBox[{"%", " ", "f"}], ",", 
      RowBox[{"{", 
       RowBox[{"\[Theta]", ",", 
        RowBox[{"1", "-", "d"}], ",", "\[Theta]switchE"}], "}"}]}], "]"}], 
    ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{"u", "-", 
          RowBox[{"(", 
           RowBox[{
            RowBox[{"a1", " ", "q1"}], "+", 
            RowBox[{"a2", " ", 
             RowBox[{"q1", "^", "2"}]}], "+", "k"}], ")"}]}], "/.", 
         RowBox[{"q2", "\[Rule]", "0"}]}], "/.", 
        RowBox[{"q1", "\[Rule]", "q1E"}]}], "/.", "contrEunconstr"}], "/.", 
      RowBox[{"k", "->", "KEconstr"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Integrate", "[", 
     RowBox[{
      RowBox[{"%", " ", "f"}], ",", 
      RowBox[{"{", 
       RowBox[{"\[Theta]", ",", "\[Theta]switchE", ",", 
        RowBox[{"1", "+", "d"}]}], "}"}]}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"CSEconstr", "=", 
    RowBox[{"FullSimplify", "[", 
     RowBox[{"%", "+", "%%%"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.888044239326185*^9, 3.8880442617464232`*^9}, {
  3.9235665870542088`*^9, 3.9235665934337835`*^9}},
 CellLabel->
  "In[211]:=",ExpressionUUID->"469f89bc-632c-4499-a224-f3d537ed45bb"],

Cell[BoxData[
 FractionBox[
  RowBox[{
   SuperscriptBox[
    RowBox[{"(", 
     RowBox[{"1", "+", "c"}], ")"}], "3"], "+", 
   RowBox[{"6", " ", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "2"}], "+", "c"}], ")"}], "2"], " ", "d"}], "+", 
   RowBox[{"2", " ", 
    SuperscriptBox["d", "3"]}]}], 
  RowBox[{"12", " ", "d"}]]], "Output",
 CellChangeTimes->{3.8880442633697405`*^9, 3.888145117737541*^9, 
  3.8883037724993677`*^9, 3.8916612378392773`*^9, 3.9224990721168613`*^9, 
  3.9235665950471106`*^9, 3.923627682323429*^9, 3.92458303779245*^9, 
  3.9263926533079367`*^9, 3.9270856141595693`*^9},
 CellLabel->
  "Out[215]=",ExpressionUUID->"9c5b8c94-a437-4732-8fbd-bdb282594bda"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
    "Combining", " ", "the", " ", "profit", " ", "of", " ", "seller", " ", 
     "1"}], ":"}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"Line", "[", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"dExcl", ",", "0"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"dExcl", ",", "1"}], "}"}]}], "}"}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"ProfitEunconstr", ",", "ProfitEconstr"}], "}"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"Manipulate", "[", 
    RowBox[{
     RowBox[{"Plot", "[", 
      RowBox[{"%", ",", 
       RowBox[{"{", 
        RowBox[{"d", ",", "0", ",", "1"}], "}"}], ",", 
       RowBox[{"Epilog", "\[Rule]", 
        RowBox[{"{", "%%", "}"}]}]}], "]"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"c", ",", "0.3"}], "}"}], ",", "0", ",", 
       RowBox[{"1", "/", "2"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"\[Gamma]", ",", "0.3"}], "}"}], ",", "0", ",", "1"}], 
      "}"}]}], "]"}]}]}]], "Input",
 CellChangeTimes->{{3.8865689863544784`*^9, 3.886569022025283*^9}, {
  3.886575102583894*^9, 3.886575102885115*^9}, {3.9235666089704375`*^9, 
  3.9235666212413197`*^9}},
 CellLabel->
  "In[452]:=",ExpressionUUID->"04598ccb-883f-4458-8b63-30a0ada509ec"],

Cell[BoxData[
 TagBox[
  StyleBox[
   DynamicModuleBox[{$CellContext`c$$ = 0.3, $CellContext`\[Gamma]$$ = 0.3, 
    Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, 
    Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 
    1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{
       Hold[$CellContext`c$$], 0.3}, 0, 
      Rational[1, 2]}, {{
       Hold[$CellContext`\[Gamma]$$], 0.3}, 0, 1}}, Typeset`size$$ = {
    360., {106., 110.9016137737539}}, Typeset`update$$ = 0, 
    Typeset`initDone$$, Typeset`skipInitDone$$ = True}, 
    DynamicBox[Manipulate`ManipulateBoxes[
     1, StandardForm, 
      "Variables" :> {$CellContext`c$$ = 0.3, $CellContext`\[Gamma]$$ = 0.3}, 
      "ControllerVariables" :> {}, 
      "OtherVariables" :> {
       Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, 
        Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, 
        Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$,
         Typeset`skipInitDone$$}, "Body" :> 
      Plot[{$CellContext`c$$ + 
         Rational[-1, 2] $CellContext`c$$^2 - $CellContext`c$$ $CellContext`d + 
         Rational[
           2, 3] $CellContext`d^2, $CellContext`c$$ - $CellContext`c$$^2 + 
         Rational[1, 12] $CellContext`c$$^3/$CellContext`d}, {$CellContext`d, 
         0, 1}, Epilog -> {
          
          Line[{{Rational[1, 2] $CellContext`c$$, 0}, {
            Rational[1, 2] $CellContext`c$$, 1}}]}], 
      "Specifications" :> {{{$CellContext`c$$, 0.3}, 0, 
         Rational[1, 2]}, {{$CellContext`\[Gamma]$$, 0.3}, 0, 1}}, 
      "Options" :> {}, "DefaultOptions" :> {}],
     ImageSizeCache->{817., {135., 141.}},
     SingleEvaluation->True],
    Deinitialization:>None,
    DynamicModuleValues:>{},
    SynchronousInitialization->True,
    UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$},
    UnsavedVariables:>{Typeset`initDone$$},
    UntrackedVariables:>{Typeset`size$$}], "Manipulate",
   Deployed->True,
   StripOnInput->False],
  Manipulate`InterpretManipulate[1]]], "Output",
 CellChangeTimes->{
  3.886569022852818*^9, {3.8865750965887527`*^9, 3.8865751032010145`*^9}, 
   3.8865789860603924`*^9, 3.886656803056784*^9, 3.8877710008840785`*^9, 
   3.887992565325554*^9, 3.8881451178125024`*^9, 3.888303772592991*^9, 
   3.891661237866852*^9, 3.922499072139021*^9, 3.923566621908856*^9, 
   3.923627684653407*^9, 3.92458303780811*^9, 3.9270856142322683`*^9, 
   3.927087184988631*^9, 3.9270875811066227`*^9},
 CellLabel->
  "Out[454]=",ExpressionUUID->"00189a6b-b112-4b40-af31-b459b95833bf"]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"ProfitEall", "=", 
   RowBox[{"Piecewise", "[", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{"ProfitEconstr", ",", 
        RowBox[{"d", "\[GreaterEqual]", "dExcl"}]}], " ", "}"}], ",", 
      RowBox[{"{", 
       RowBox[{"ProfitEunconstr", ",", 
        RowBox[{"d", "\[LessEqual]", "dExcl"}]}], "}"}]}], "}"}], "]"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.8865683532582455`*^9, 3.886568435155924*^9}, 
   3.9270871728000555`*^9, 3.9270875903510017`*^9},
 CellLabel->
  "In[456]:=",ExpressionUUID->"8fbbe756-1122-4b9d-a705-fcc3e040242f"],

Cell[BoxData[
 RowBox[{
  RowBox[{"CSEall", "=", 
   RowBox[{"Piecewise", "[", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{"CSEconstr", ",", 
        RowBox[{"d", "\[GreaterEqual]", "dExcl"}]}], " ", "}"}], ",", 
      RowBox[{"{", 
       RowBox[{"CSEunconstr", ",", 
        RowBox[{"d", "\[LessEqual]", "dExcl"}]}], "}"}]}], "}"}], "]"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.888044276550438*^9, 3.888044282815748*^9}},
 CellLabel->
  "In[220]:=",ExpressionUUID->"c5217b0d-f95d-4b59-9512-39e95c17038b"]
}, Closed]],

Cell[CellGroupData[{

Cell["3 Sequential competition with non-linear pricing", "Section",
 CellChangeTimes->{{3.8866575230949965`*^9, 3.886657527580717*^9}, {
  3.9235650480393085`*^9, 3.923565060490631*^9}, {3.9236235251752567`*^9, 
  3.923623525346115*^9}},ExpressionUUID->"c5e20ee4-bdcf-49b3-9e3b-\
209e9b51330c"],

Cell[BoxData[
 RowBox[{"(*", 
  RowBox[{
   RowBox[{
    RowBox[{"Timing", ".", " ", "The"}], " ", "leader", " ", "seller", " ", 
    "1", " ", "offers", " ", "the", " ", "contract"}], ",", " ", 
   RowBox[{
   "follower", " ", "seller", " ", "2", " ", "observes", " ", "it", " ", 
    "and", " ", "offers", " ", "its", " ", "contract"}], ",", " ", 
   RowBox[{"the", " ", "agent", " ", "chooses", " ", "at", " ", "the", " ", 
    RowBox[{"end", "."}]}]}], "*)"}]], "Input",
 CellChangeTimes->{{3.923565084777109*^9, 3.923565142321291*^9}, {
  3.9235651901163006`*^9, 3.9235651963592043`*^9}},
 CellLabel->
  "In[221]:=",ExpressionUUID->"c2b7b983-4523-4458-b532-4c7905e155a5"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"By", " ", "backward", " ", 
    RowBox[{"induction", ":", " ", 
     RowBox[{"optimal", " ", "contract", " ", "of", " ", "seller", " ", "2"}],
      ":"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"P1", "=", 
     RowBox[{
      RowBox[{"a1", " ", "q1"}], "+", 
      RowBox[{"a2", " ", 
       RowBox[{"q1", "^", "2"}]}], "+", "a0"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"u", "-", "P1"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"q1q2", "=", 
     RowBox[{
      RowBox[{"FullSimplify", "[", 
       RowBox[{"Solve", "[", 
        RowBox[{
         RowBox[{
          RowBox[{"D", "[", 
           RowBox[{"%", ",", "q1"}], "]"}], "\[Equal]", "0"}], ",", "q1"}], 
        "]"}], "]"}], "[", 
      RowBox[{"[", 
       RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"V2", "=", 
     RowBox[{"FullSimplify", "[", 
      RowBox[{"%%", "/.", 
       RowBox[{"q1", "\[Rule]", "q1q2"}]}], "]"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"V2", "-", 
     RowBox[{"c", " ", "q2"}], "-", 
     RowBox[{
      RowBox[{
       RowBox[{"(", 
        RowBox[{"1", "-", "F"}], ")"}], "/", "f"}], " ", 
      RowBox[{"D", "[", 
       RowBox[{"V2", ",", "\[Theta]"}], "]"}]}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"q2dir", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{
         RowBox[{"D", "[", 
          RowBox[{"%", ",", "q2"}], "]"}], "\[Equal]", "0"}], ",", "q2"}], 
       "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.8866524874266653`*^9, 3.8866524994720483`*^9}, {
  3.8866526276706314`*^9, 3.8866527384908466`*^9}, {3.8866527704623814`*^9, 
  3.8866527844270463`*^9}, {3.8866529256887045`*^9, 3.886652943599907*^9}, {
  3.8866577253528543`*^9, 3.8866577257286224`*^9}, {3.9235651737219987`*^9, 
  3.923565214271796*^9}, {3.9236277570834656`*^9, 3.923627772217005*^9}, {
  3.9264367888056726`*^9, 3.926436808940792*^9}},
 CellLabel->
  "In[222]:=",ExpressionUUID->"ab2b512a-22b5-41b0-ae7e-79a764e9b91b"],

Cell[BoxData[
 RowBox[{"-", 
  FractionBox[
   RowBox[{
    RowBox[{"-", "1"}], "+", "c", "+", "d", "+", "\[Gamma]", "-", 
    RowBox[{"a1", " ", "\[Gamma]"}], "-", 
    RowBox[{"d", " ", "\[Gamma]"}], "+", 
    RowBox[{"2", " ", "a2", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "c", "+", "d", "-", 
       RowBox[{"2", " ", "\[Theta]"}]}], ")"}]}], "+", 
    RowBox[{"2", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], " ", "\[Theta]"}]}], 
   RowBox[{"1", "+", 
    RowBox[{"2", " ", "a2"}], "-", 
    SuperscriptBox["\[Gamma]", "2"]}]]}]], "Output",
 CellChangeTimes->{{3.8866527129866886`*^9, 3.8866527392610297`*^9}, 
   3.88665278563312*^9, 3.8866529442473893`*^9, 3.8866568523517838`*^9, 
   3.8866577274391756`*^9, 3.887771413096177*^9, 3.923565215366073*^9, 
   3.9236278013215885`*^9, 3.924583037993044*^9, {3.926436775989515*^9, 
   3.926436814704686*^9}, 3.9270856152155776`*^9},
 CellLabel->
  "Out[227]=",ExpressionUUID->"01b38a3f-512e-491b-aa32-4e2cc08c3786"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Collect", "[", 
  RowBox[{"V2", ",", "q2", ",", "FullSimplify"}], "]"}]], "Input",
 CellChangeTimes->{{3.926436818552867*^9, 3.926436829392141*^9}},
 CellLabel->
  "In[228]:=",ExpressionUUID->"1ca3d014-7c95-42df-b857-ac163e520078"],

Cell[BoxData[
 RowBox[{
  FractionBox[
   RowBox[{
    SuperscriptBox["q2", "2"], " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "-", 
      RowBox[{"2", " ", "a2"}], "+", 
      SuperscriptBox["\[Gamma]", "2"]}], ")"}]}], 
   RowBox[{"2", "+", 
    RowBox[{"4", " ", "a2"}]}]], "+", 
  FractionBox[
   RowBox[{"q2", " ", 
    RowBox[{"(", 
     RowBox[{"1", "+", 
      RowBox[{"\[Gamma]", " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"-", "1"}], "+", "a1", "-", "\[Theta]"}], ")"}]}], "+", 
      "\[Theta]", "+", 
      RowBox[{"2", " ", "a2", " ", 
       RowBox[{"(", 
        RowBox[{"1", "+", "\[Theta]"}], ")"}]}]}], ")"}]}], 
   RowBox[{"1", "+", 
    RowBox[{"2", " ", "a2"}]}]], "+", 
  FractionBox[
   RowBox[{
    RowBox[{
     RowBox[{"-", "2"}], " ", "a0", " ", 
     RowBox[{"(", 
      RowBox[{"1", "+", 
       RowBox[{"2", " ", "a2"}]}], ")"}]}], "+", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{"1", "-", "a1", "+", "\[Theta]"}], ")"}], "2"]}], 
   RowBox[{"2", "+", 
    RowBox[{"4", " ", "a2"}]}]]}]], "Output",
 CellChangeTimes->{3.927085615418989*^9},
 CellLabel->
  "Out[228]=",ExpressionUUID->"f852895a-3061-4a93-a2c8-b2e0d9b49da0"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", "Implementation", "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{"q2ind", "-", "q2dir"}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", "0"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"q2ind", "-", "q2dir", "-", 
      RowBox[{"(", "%", ")"}]}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", "1"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{
      RowBox[{"%", "\[Equal]", "0"}], ",", 
      RowBox[{"%%", "\[Equal]", "0"}]}], "}"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"tmpseq2", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{"%", ",", 
        RowBox[{"{", 
         RowBox[{"b1", ",", "b2"}], "}"}]}], "]"}], "]"}], "[", 
     RowBox[{"[", "1", "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.8866528788859196`*^9, 3.8866529064151373`*^9}, {
  3.8866529723888717`*^9, 3.886652995449687*^9}, {3.8866530748247943`*^9, 
  3.8866530757209544`*^9}, {3.8866577455726852`*^9, 3.8866577631986446`*^9}, {
  3.9235652240587177`*^9, 3.923565235106711*^9}},
 CellLabel->
  "In[229]:=",ExpressionUUID->"bc305541-74a6-403c-9df4-748fb329545d"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"b1", "\[Rule]", 
    FractionBox[
     RowBox[{"1", "+", "c", "+", "d", "+", 
      RowBox[{"2", " ", "a2", " ", 
       RowBox[{"(", 
        RowBox[{"1", "+", "c", "+", "d"}], ")"}]}], "+", 
      RowBox[{
       RowBox[{"(", 
        RowBox[{
         RowBox[{"-", "1"}], "+", "a1", "-", "d"}], ")"}], " ", 
       "\[Gamma]"}]}], 
     RowBox[{"2", "+", 
      RowBox[{"4", " ", "a2"}]}]]}], ",", 
   RowBox[{"b2", "\[Rule]", 
    FractionBox[
     RowBox[{
      RowBox[{"-", "1"}], "-", 
      RowBox[{"2", " ", "a2"}], "+", 
      SuperscriptBox["\[Gamma]", "2"]}], 
     RowBox[{"4", "+", 
      RowBox[{"8", " ", "a2"}]}]]}]}], "}"}]], "Output",
 CellChangeTimes->{
  3.8866529117695293`*^9, 3.8866530000473194`*^9, 3.8866530303939247`*^9, 
   3.886653076286203*^9, 3.8866568596776085`*^9, {3.886657757970272*^9, 
   3.8866577640591984`*^9}, 3.8877714184719486`*^9, 3.9225036866839447`*^9, 
   3.9235652353533373`*^9, 3.92362780651897*^9, 3.9245830380398593`*^9, 
   3.9264367816938906`*^9, 3.9270856155585065`*^9},
 CellLabel->
  "Out[232]=",ExpressionUUID->"5f3af360-9e79-44ba-9745-c574e4a3e0fa"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
    "Determining", " ", "the", " ", "fixed", " ", "fee", " ", "b0", " ", "of",
      " ", "seller", " ", 
     RowBox[{"2", "'"}], "s", " ", "contract"}], ",", " ", 
    RowBox[{"making", " ", "the", " ", "lowest", " ", "type", " ", 
     RowBox[{"indifferent", ":"}]}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"P2", "=", 
     RowBox[{
      RowBox[{"b1", " ", "q2"}], "+", 
      RowBox[{"b2", " ", 
       RowBox[{"q2", "^", "2"}]}], "+", "b0"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"u", "-", "P1", "-", "P2"}], "/.", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"q1", "\[Rule]", "q1ind"}], ",", 
         RowBox[{"q2", "\[Rule]", "q2ind"}]}], "}"}]}], "/.", "tmpseq2"}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", 
      RowBox[{"-", "d"}]}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"u", "-", "P1"}], "/.", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"q1", "\[Rule]", "q1Eind"}], ",", 
        RowBox[{"q2", "\[Rule]", "0"}]}], "}"}]}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", 
      RowBox[{"-", "d"}]}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"b0tmp", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{"%", "\[Equal]", "%%"}], ",", "b0"}], "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.922503728386261*^9, 3.9225038331955347`*^9}, {
  3.9235653154320354`*^9, 3.923565363397353*^9}, {3.9236278250619907`*^9, 
  3.923627857269311*^9}, {3.9264378859824705`*^9, 3.926437889369423*^9}},
 CellLabel->
  "In[233]:=",ExpressionUUID->"85f2df62-6159-4b8f-95eb-5de4f2a55086"],

Cell[BoxData[
 FractionBox[
  SuperscriptBox[
   RowBox[{"(", 
    RowBox[{
     RowBox[{
      RowBox[{"(", 
       RowBox[{"1", "+", 
        RowBox[{"2", " ", "a2"}]}], ")"}], " ", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "1"}], "+", "c", "+", 
        RowBox[{"3", " ", "d"}]}], ")"}]}], "-", 
     RowBox[{
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "1"}], "+", "a1", "+", 
        RowBox[{"3", " ", "d"}]}], ")"}], " ", "\[Gamma]"}]}], ")"}], "2"], 
  RowBox[{"4", " ", 
   RowBox[{"(", 
    RowBox[{"1", "+", 
     RowBox[{"2", " ", "a2"}]}], ")"}], " ", 
   RowBox[{"(", 
    RowBox[{"1", "+", 
     RowBox[{"2", " ", "a2"}], "-", 
     SuperscriptBox["\[Gamma]", "2"]}], ")"}]}]]], "Output",
 CellChangeTimes->{{3.922503808587827*^9, 3.922503835739996*^9}, 
   3.9235654779959335`*^9, 3.9236279061525826`*^9, 3.9245830380777473`*^9, 
   3.9264378209567738`*^9, {3.926437887743929*^9, 3.9264378900420494`*^9}, 
   3.9270856156970453`*^9},
 CellLabel->
  "Out[236]=",ExpressionUUID->"c3c455d8-2d83-421d-b8a1-9fe3185d2644"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"TeXForm", "[", 
  FractionBox[
   SuperscriptBox[
    RowBox[{"(", 
     RowBox[{
      RowBox[{
       RowBox[{"(", 
        RowBox[{"1", "+", 
         RowBox[{"2", " ", "a2"}]}], ")"}], " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"-", "1"}], "+", "c", "+", 
         RowBox[{"3", " ", "d"}]}], ")"}]}], "-", 
      RowBox[{
       RowBox[{"(", 
        RowBox[{
         RowBox[{"-", "1"}], "+", "a1", "+", 
         RowBox[{"3", " ", "d"}]}], ")"}], " ", "\[Gamma]"}]}], ")"}], "2"], 
   RowBox[{"4", " ", 
    RowBox[{"(", 
     RowBox[{"1", "+", 
      RowBox[{"2", " ", "a2"}]}], ")"}], " ", 
    RowBox[{"(", 
     RowBox[{"1", "+", 
      RowBox[{"2", " ", "a2"}], "-", 
      SuperscriptBox["\[Gamma]", "2"]}], ")"}]}]], "]"}]], "Input",
 CellChangeTimes->{{3.9251837608199244`*^9, 3.925183767538619*^9}},
 CellLabel->
  "In[237]:=",ExpressionUUID->"5b294956-5e8f-4755-8680-ed0fdb8913ba"],

Cell["\<\
\\frac{((2 \\text{a2}+1) (c+3 d-1)-\\gamma  (\\text{a1}+3 d-1))^2}{4 (2 \
\\text{a2}+1) \\left(2 \\text{a2}-\\gamma ^2+1\\right)}\
\>", "Output",
 CellChangeTimes->{3.925183768076948*^9, 3.9270856157657976`*^9},
 CellLabel->
  "Out[237]//TeXForm=",ExpressionUUID->"3f0b66ea-35c8-4624-9e6f-59c68195c0fe"]
}, Open  ]],

Cell[BoxData[
 RowBox[{"(*", 
  RowBox[{
  "Now", " ", "we", " ", "determine", " ", "the", " ", "optimal", " ", 
   "contract", " ", "offered", " ", "by", " ", "seller", " ", "1."}], 
  "*)"}]], "Input",
 CellChangeTimes->{{3.923565519109375*^9, 3.9235655202045703`*^9}},
 CellLabel->
  "In[238]:=",ExpressionUUID->"3e3a1d25-c977-46dc-8f79-c62633828872"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
    "Seller", " ", "1", " ", "must", " ", "insure", " ", "that", " ", 
     "seller", " ", "2", " ", "does", " ", "not", " ", "want", " ", "to", " ",
      "deviate", " ", "to", " ", "exclusivity", " ", "with", " ", "the", " ", 
     RowBox[{"buyer", ".", " ", "The"}], " ", "optimal", " ", "deviation", 
     " ", "would", " ", "leave", " ", "the", " ", "lowest", " ", "type", " ", 
     "of", " ", "buyer", " ", "indifferent", " ", "between", " ", "the", " ", 
     "candidate", " ", "equilibrium", " ", "payoff", " ", "and", " ", "the", 
     " ", "deviation", " ", "payoff", " ", "which", " ", "is", " ", "the", 
     " ", "bilateral", " ", "surplus", " ", "of", " ", "seller", " ", "1", 
     " ", "and", " ", "the", " ", "buyer", " ", "under", " ", 
     RowBox[{"exclusivity", ".", " ", 
      RowBox[{"(", 
       RowBox[{
       "Note", " ", "that", " ", "the", " ", "lowest", " ", "type", " ", "is",
         " ", "the", " ", "one", " ", "seller", " ", "2", " ", "can", " ", 
        "more", " ", "easily", " ", "attract", " ", "under", " ", 
        RowBox[{"exclusivity", "."}]}], ")"}]}]}], ":"}], "*)"}], 
  "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{"u", "-", "P1", "-", "P2"}], "/.", 
         RowBox[{"{", 
          RowBox[{
           RowBox[{"q1", "\[Rule]", "q1ind"}], ",", 
           RowBox[{"q2", "\[Rule]", "q2ind"}]}], "}"}]}], "/.", "tmpseq2"}], "/.", 
       RowBox[{"\[Theta]", "\[Rule]", 
        RowBox[{"-", "d"}]}]}], "/.", 
      RowBox[{"b0", "->", "b0tmp"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"u", "-", 
      RowBox[{"c", " ", "q2"}]}], "/.", 
     RowBox[{"q1", "\[Rule]", "0"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"FullSimplify", "[", 
     RowBox[{"Solve", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"D", "[", 
         RowBox[{"%", ",", "q2"}], "]"}], "\[Equal]", "0"}], ",", "q2"}], 
      "]"}], "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"FullSimplify", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"u", "-", 
       RowBox[{"c", " ", "q2"}], "-", "b0"}], "/.", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"q1", "\[Rule]", "0"}], ",", 
        RowBox[{"q2", "\[Rule]", 
         RowBox[{"%", "[", 
          RowBox[{"[", 
           RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}]}], "}"}]}], "/.", 
     RowBox[{"\[Theta]", "\[Rule]", 
      RowBox[{"-", "d"}]}]}], "]"}], "\[IndentingNewLine]", 
   RowBox[{"b0dev", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{"%", "\[Equal]", "%%%%"}], ",", "b0"}], "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.922503951782878*^9, 3.922503985128707*^9}, {
  3.922504038457836*^9, 3.922504052705988*^9}, {3.922504095736986*^9, 
  3.922504153509581*^9}, {3.9225042548660746`*^9, 3.92250429181818*^9}, {
  3.9225043474545093`*^9, 3.9225043540616255`*^9}, {3.923565546273365*^9, 
  3.923565594147156*^9}, {3.923565645777341*^9, 3.9235657150158386`*^9}, {
  3.9235658432656403`*^9, 3.923565846122201*^9}, {3.9236282277926846`*^9, 
  3.923628247928341*^9}, {3.925199729155363*^9, 3.925199757569029*^9}, {
  3.926438094891759*^9, 3.926438097077799*^9}},
 CellLabel->
  "In[239]:=",ExpressionUUID->"0104daa5-eb55-4aec-934f-a0e93f0f59a5"],

Cell[BoxData[
 RowBox[{
  FractionBox["1", "2"], " ", 
  RowBox[{"(", 
   RowBox[{
    RowBox[{
     RowBox[{"-", "2"}], " ", "b0"}], "+", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "c", "+", "d"}], ")"}], "2"]}], 
   ")"}]}]], "Output",
 CellChangeTimes->{{3.922503952277636*^9, 3.9225039595564632`*^9}, 
   3.922504055483185*^9, {3.922504097343172*^9, 3.9225041256042604`*^9}, 
   3.9225042925160217`*^9, 3.92250435479452*^9, 3.9235657209229684`*^9, 
   3.9236282064216175`*^9, 3.923631059934349*^9, 3.924583038133363*^9, {
   3.9264380912225285`*^9, 3.9264380976374235`*^9}, 3.927085615964134*^9},
 CellLabel->
  "Out[242]=",ExpressionUUID->"37b38bf1-ce12-467a-b73d-d1d581eec4dc"],

Cell[BoxData[
 RowBox[{"a0", "-", 
  FractionBox[
   SuperscriptBox[
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "a1", "+", "d"}], ")"}], "2"], 
   RowBox[{"2", "+", 
    RowBox[{"4", " ", "a2"}]}]], "+", 
  RowBox[{
   FractionBox["1", "2"], " ", 
   SuperscriptBox[
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "c", "+", "d"}], ")"}], "2"]}]}]], "Output",
 CellChangeTimes->{{3.922503952277636*^9, 3.9225039595564632`*^9}, 
   3.922504055483185*^9, {3.922504097343172*^9, 3.9225041256042604`*^9}, 
   3.9225042925160217`*^9, 3.92250435479452*^9, 3.9235657209229684`*^9, 
   3.9236282064216175`*^9, 3.923631059934349*^9, 3.924583038133363*^9, {
   3.9264380912225285`*^9, 3.9264380976374235`*^9}, 3.927085616353402*^9},
 CellLabel->
  "Out[243]=",ExpressionUUID->"84be0f34-5eae-42d4-b089-b6d0c3cb4bb4"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"TeXForm", "[", 
  RowBox[{"a0", "-", 
   FractionBox[
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "a1", "+", "d"}], ")"}], "2"], 
    RowBox[{"2", "+", 
     RowBox[{"4", " ", "a2"}]}]], "+", 
   RowBox[{
    FractionBox["1", "2"], " ", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "c", "+", "d"}], ")"}], "2"]}]}], 
  "]"}]], "Input",
 CellChangeTimes->{{3.925200356644777*^9, 3.9252003664081507`*^9}},
 CellLabel->
  "In[244]:=",ExpressionUUID->"9526a133-9799-4ab3-b8d9-722c68c227d0"],

Cell["\<\
\\text{a0}-\\frac{(\\text{a1}+d-1)^2}{4 \\text{a2}+2}+\\frac{1}{2} (c+d-1)^2\
\>", "Output",
 CellChangeTimes->{3.9252003668615327`*^9, 3.9270856164834795`*^9},
 CellLabel->
  "Out[244]//TeXForm=",ExpressionUUID->"b962a246-53ee-4abd-a36f-3402b7527ebf"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"Hence", ",", " ", 
    RowBox[{
    "in", " ", "the", " ", "deviation", " ", "seller", " ", "2", " ", "makes",
      " ", "a", " ", "profit", " ", "which", " ", "is", " ", "precisely", " ",
      "the", " ", "deviation", " ", "fixed", " ", "fee", " ", 
     RowBox[{
      RowBox[{"(", 
       RowBox[{
       "the", " ", "optimal", " ", "bilateral", " ", "surplus", " ", "is", 
        " ", "obtained", " ", "with", " ", "a", " ", "marginal", " ", "price",
         " ", "equal", " ", "to", " ", 
        RowBox[{"2", "'"}], "s", " ", "marginal", " ", "cost"}], ")"}], ".", 
      "\[IndentingNewLine]", "Hence"}]}], ",", " ", 
    RowBox[{
    "seller", " ", "1", " ", "setsthe", " ", "fixed", " ", "fee", " ", "such",
      " ", "that", " ", "seller", " ", "2", " ", "is", " ", "indifferent", 
     " ", "with", " ", "the", " ", "candidate", " ", "equilibrium", " ", 
     "payoff", " ", "and", " ", "the", " ", "deviation", " ", "to", " ", 
     RowBox[{"exclusivity", ":"}]}]}], "*)"}], "\[IndentingNewLine]", 
  "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{"Profit2seqmin", "=", 
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{"P2", "-", 
          RowBox[{"c", " ", "q2"}]}], "/.", 
         RowBox[{"q2", "\[Rule]", "q2ind"}]}], "/.", "tmpseq2"}], "/.", 
       RowBox[{"\[Theta]", "\[Rule]", 
        RowBox[{"-", "d"}]}]}], "/.", 
      RowBox[{"b0", "->", "b0tmp"}]}], "]"}]}], "\n", "\[IndentingNewLine]", 
   RowBox[{"a0tmp", "=", 
    RowBox[{
     RowBox[{"FullSimplify", "[", 
      RowBox[{"Solve", "[", 
       RowBox[{
        RowBox[{"Profit2seqmin", "==", "b0dev"}], ",", " ", "a0"}], "]"}], 
      "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.922504319657256*^9, 3.922504395240944*^9}, {
   3.9235657283242426`*^9, 3.92356582110663*^9}, {3.9235658600755777`*^9, 
   3.923565863532019*^9}, {3.92362820901762*^9, 3.9236282099685087`*^9}, 
   3.9264381767668343`*^9},
 CellLabel->
  "In[245]:=",ExpressionUUID->"9141cd1f-d5e6-4a40-88d2-9c821973c4fa"],

Cell[BoxData[
 FractionBox[
  RowBox[{
   RowBox[{"(", 
    RowBox[{
     RowBox[{
      RowBox[{"(", 
       RowBox[{"1", "+", 
        RowBox[{"2", " ", "a2"}]}], ")"}], " ", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "1"}], "+", "c", "-", "d"}], ")"}]}], "+", 
     RowBox[{
      RowBox[{"(", 
       RowBox[{"1", "-", "a1", "+", "d"}], ")"}], " ", "\[Gamma]"}]}], ")"}], 
   " ", 
   RowBox[{"(", 
    RowBox[{
     RowBox[{
      RowBox[{"(", 
       RowBox[{"1", "+", 
        RowBox[{"2", " ", "a2"}]}], ")"}], " ", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "1"}], "+", "c", "+", 
        RowBox[{"3", " ", "d"}]}], ")"}]}], "-", 
     RowBox[{
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "1"}], "+", "a1", "+", 
        RowBox[{"3", " ", "d"}]}], ")"}], " ", "\[Gamma]"}]}], ")"}]}], 
  RowBox[{"2", " ", 
   RowBox[{"(", 
    RowBox[{"1", "+", 
     RowBox[{"2", " ", "a2"}]}], ")"}], " ", 
   RowBox[{"(", 
    RowBox[{"1", "+", 
     RowBox[{"2", " ", "a2"}], "-", 
     SuperscriptBox["\[Gamma]", "2"]}], ")"}]}]]], "Output",
 CellChangeTimes->{{3.9225043781851377`*^9, 3.9225043983842335`*^9}, 
   3.9235658230201044`*^9, 3.9235658644783745`*^9, 3.9236282105676594`*^9, 
   3.9245830383263903`*^9, 3.9264381823987885`*^9, 3.9270856166165457`*^9},
 CellLabel->
  "Out[245]=",ExpressionUUID->"c9e581b6-c77e-40e2-8cf8-b90ca7e11e34"],

Cell[BoxData[
 RowBox[{
  FractionBox[
   SuperscriptBox[
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "a1", "+", "d"}], ")"}], "2"], 
   RowBox[{"2", "+", 
    RowBox[{"4", " ", "a2"}]}]], "-", 
  RowBox[{
   FractionBox["1", "2"], " ", 
   SuperscriptBox[
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "1"}], "+", "c", "+", "d"}], ")"}], "2"]}], "+", 
  FractionBox[
   RowBox[{
    RowBox[{"(", 
     RowBox[{
      RowBox[{
       RowBox[{"(", 
        RowBox[{"1", "+", 
         RowBox[{"2", " ", "a2"}]}], ")"}], " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"-", "1"}], "+", "c", "-", "d"}], ")"}]}], "+", 
      RowBox[{
       RowBox[{"(", 
        RowBox[{"1", "-", "a1", "+", "d"}], ")"}], " ", "\[Gamma]"}]}], ")"}],
     " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{
       RowBox[{"(", 
        RowBox[{"1", "+", 
         RowBox[{"2", " ", "a2"}]}], ")"}], " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"-", "1"}], "+", "c", "+", 
         RowBox[{"3", " ", "d"}]}], ")"}]}], "-", 
      RowBox[{
       RowBox[{"(", 
        RowBox[{
         RowBox[{"-", "1"}], "+", "a1", "+", 
         RowBox[{"3", " ", "d"}]}], ")"}], " ", "\[Gamma]"}]}], ")"}]}], 
   RowBox[{"2", " ", 
    RowBox[{"(", 
     RowBox[{"1", "+", 
      RowBox[{"2", " ", "a2"}]}], ")"}], " ", 
    RowBox[{"(", 
     RowBox[{"1", "+", 
      RowBox[{"2", " ", "a2"}], "-", 
      SuperscriptBox["\[Gamma]", "2"]}], ")"}]}]]}]], "Output",
 CellChangeTimes->{{3.9225043781851377`*^9, 3.9225043983842335`*^9}, 
   3.9235658230201044`*^9, 3.9235658644783745`*^9, 3.9236282105676594`*^9, 
   3.9245830383263903`*^9, 3.9264381823987885`*^9, 3.9270856203724155`*^9},
 CellLabel->
  "Out[246]=",ExpressionUUID->"eca60f05-cea4-45ed-bd0b-9f2528da3707"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{"Now", ",", " ", 
    RowBox[{
    "the", " ", "variable", " ", "parts", " ", "of", " ", "seller", " ", 
     RowBox[{"1", "'"}], "s", " ", "tariff", " ", "are", " ", "determined", 
     " ", "with", " ", "direct", " ", 
     RowBox[{"optimization", ":"}]}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"P1", "/.", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"q1", "\[Rule]", "q1ind"}], ",", 
       RowBox[{"q2", "\[Rule]", "q2ind"}]}], "}"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Integrate", "[", 
     RowBox[{
      RowBox[{"%", " ", "f"}], ",", 
      RowBox[{"{", 
       RowBox[{"\[Theta]", ",", 
        RowBox[{"-", "d"}], ",", 
        RowBox[{"+", "d"}]}], "}"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"Profit1tmp", "=", 
    RowBox[{"FullSimplify", "[", 
     RowBox[{
      RowBox[{"%", "/.", "tmpseq2"}], "/.", 
      RowBox[{"a0", "\[Rule]", "a0tmp"}]}], "]"}]}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Simplify", "[", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{
        RowBox[{"D", "[", 
         RowBox[{"%", ",", "a1"}], "]"}], "\[Equal]", "0"}], ",", 
       RowBox[{
        RowBox[{"D", "[", 
         RowBox[{"%", ",", "a2"}], "]"}], "\[Equal]", "0"}]}], "}"}], "]"}], 
    ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"solseqtmp", "=", 
     RowBox[{"Solve", "[", 
      RowBox[{"%", ",", 
       RowBox[{"{", 
        RowBox[{"a1", ",", "a2"}], "}"}]}], "]"}]}], ";"}]}]}]], "Input",
 CellChangeTimes->{{3.922504402028167*^9, 3.922504415240595*^9}, {
   3.9235658787713213`*^9, 3.9235659041004515`*^9}, 3.9235659464654465`*^9, {
   3.92643819023571*^9, 3.9264381927957034`*^9}, {3.9265599978097005`*^9, 
   3.9265600005792513`*^9}, 3.926561568213525*^9},
 CellLabel->
  "In[247]:=",ExpressionUUID->"89bf458f-eeba-46ee-adb7-b7e58811ffdd"],

Cell[BoxData[
 RowBox[{
  FractionBox["1", "2"], " ", 
  RowBox[{"(", 
   RowBox[{
    FractionBox[
     SuperscriptBox[
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "1"}], "+", "a1", "+", "d"}], ")"}], "2"], 
     RowBox[{"1", "+", 
      RowBox[{"2", " ", "a2"}]}]], "-", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", "c", "+", "d"}], ")"}], "2"], "+", 
    FractionBox[
     RowBox[{
      RowBox[{"(", 
       RowBox[{
        RowBox[{
         RowBox[{"(", 
          RowBox[{"1", "+", 
           RowBox[{"2", " ", "a2"}]}], ")"}], " ", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", "1"}], "+", "c", "-", "d"}], ")"}]}], "+", 
        RowBox[{
         RowBox[{"(", 
          RowBox[{"1", "-", "a1", "+", "d"}], ")"}], " ", "\[Gamma]"}]}], 
       ")"}], " ", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{
         RowBox[{"(", 
          RowBox[{"1", "+", 
           RowBox[{"2", " ", "a2"}]}], ")"}], " ", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", "1"}], "+", "c", "+", 
           RowBox[{"3", " ", "d"}]}], ")"}]}], "-", 
        RowBox[{
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", "1"}], "+", "a1", "+", 
           RowBox[{"3", " ", "d"}]}], ")"}], " ", "\[Gamma]"}]}], ")"}]}], 
     RowBox[{
      RowBox[{"(", 
       RowBox[{"1", "+", 
        RowBox[{"2", " ", "a2"}]}], ")"}], " ", 
      RowBox[{"(", 
       RowBox[{"1", "+", 
        RowBox[{"2", " ", "a2"}], "-", 
        SuperscriptBox["\[Gamma]", "2"]}], ")"}]}]], "+", 
    RowBox[{"2", " ", "a1", " ", 
     RowBox[{"(", 
      RowBox[{
       FractionBox["d", 
        RowBox[{"1", "+", 
         RowBox[{"2", " ", "a2"}]}]], "+", 
       FractionBox[
        RowBox[{
         RowBox[{"-", "1"}], "+", "a1", "+", "d", "-", 
         RowBox[{
          RowBox[{"(", 
           RowBox[{
            RowBox[{"-", "1"}], "+", "c", "+", "d"}], ")"}], " ", 
          "\[Gamma]"}]}], 
        RowBox[{
         RowBox[{"-", "1"}], "-", 
         RowBox[{"2", " ", "a2"}], "+", 
         SuperscriptBox["\[Gamma]", "2"]}]]}], ")"}]}], "+", 
    RowBox[{
     RowBox[{"(", 
      RowBox[{"a2", " ", 
       RowBox[{"(", 
        RowBox[{"2", "+", 
         RowBox[{"4", " ", "a2"}]}], ")"}], " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{
          SuperscriptBox["d", "2"], " ", 
          SuperscriptBox[
           RowBox[{"(", 
            RowBox[{
             RowBox[{"a2", " ", 
              RowBox[{"(", 
               RowBox[{"2", "-", 
                RowBox[{"4", " ", "\[Gamma]"}]}], ")"}]}], "+", 
             SuperscriptBox[
              RowBox[{"(", 
               RowBox[{
                RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], "2"]}], ")"}], 
           "3"]}], "-", 
         RowBox[{"3", " ", 
          SuperscriptBox[
           RowBox[{"(", 
            RowBox[{
             RowBox[{
              RowBox[{"(", 
               RowBox[{
                RowBox[{"-", "1"}], "+", "a1"}], ")"}], " ", 
              RowBox[{"(", 
               RowBox[{"1", "+", 
                RowBox[{"2", " ", "a2"}]}], ")"}]}], "-", 
             RowBox[{
              RowBox[{"(", 
               RowBox[{"1", "+", 
                RowBox[{"2", " ", "a2"}]}], ")"}], " ", 
              RowBox[{"(", 
               RowBox[{
                RowBox[{"-", "1"}], "+", "c", "+", "d"}], ")"}], " ", 
              "\[Gamma]"}], "+", 
             RowBox[{"d", " ", 
              SuperscriptBox["\[Gamma]", "2"]}]}], ")"}], "2"], " ", 
          RowBox[{"(", 
           RowBox[{
            RowBox[{"-", 
             SuperscriptBox[
              RowBox[{"(", 
               RowBox[{
                RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], "2"]}], "+", 
            RowBox[{"a2", " ", 
             RowBox[{"(", 
              RowBox[{
               RowBox[{"-", "2"}], "+", 
               RowBox[{"4", " ", "\[Gamma]"}]}], ")"}]}]}], ")"}]}]}], 
        ")"}]}], ")"}], "/", 
     RowBox[{"(", 
      RowBox[{"3", " ", 
       SuperscriptBox[
        RowBox[{"(", 
         RowBox[{"1", "+", 
          RowBox[{"2", " ", "a2"}]}], ")"}], "3"], " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"a2", " ", 
          RowBox[{"(", 
           RowBox[{"2", "-", 
            RowBox[{"4", " ", "\[Gamma]"}]}], ")"}]}], "+", 
         SuperscriptBox[
          RowBox[{"(", 
           RowBox[{
            RowBox[{"-", "1"}], "+", "\[Gamma]"}], ")"}], "2"]}], ")"}], " ", 
       SuperscriptBox[
        RowBox[{"(", 
         RowBox[{
          RowBox[{"-", "1"}], "-", 
          RowBox[{"2", " ", "a2"}], "+", 
          SuperscriptBox["\[Gamma]", "2"]}], ")"}], "2"]}], ")"}]}]}], 
   ")"}]}]], "Output",
 CellChangeTimes->{3.926561581026971*^9, 3.926562089638917*^9, 
  3.9270856406950912`*^9},
 CellLabel->
  "Out[249]=",ExpressionUUID->"c3535642-18bc-4501-baff-0d310247b27c"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"There", " ", "are", " ", "several", " ", "solutions"}], ",", " ", 
    RowBox[{
    "but", " ", "the", " ", "number", " ", "4", " ", "is", " ", "the", " ", 
     "equilibrium"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"param", "=", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"c", "\[Rule]", "0.1"}], ",", 
       RowBox[{"d", "\[Rule]", "0.2"}], ",", 
       RowBox[{"\[Gamma]", "\[Rule]", "0.5"}]}], "}"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"solseqtmp", "[", 
      RowBox[{"[", "4", "]"}], "]"}], "/.", "param"}], "/.", 
    RowBox[{"\[Theta]", "\[Rule]", "0.9"}]}], "\[IndentingNewLine]", 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"d", "/.", "param"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"-", "d"}], "/.", "param"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{
        RowBox[{"q1ind", "/.", "tmpseq2"}], "/.", 
        RowBox[{"solseqtmp", "[", 
         RowBox[{"[", "4", "]"}], "]"}]}], ",", "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"q2ind", "/.", "tmpseq2"}], "/.", 
        RowBox[{"solseqtmp", "[", 
         RowBox[{"[", "4", "]"}], "]"}]}]}], "\[IndentingNewLine]", "}"}], "/.",
      "param"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{"Plot", "[", 
    RowBox[{"%", ",", 
     RowBox[{"{", 
      RowBox[{"\[Theta]", ",", "%%", ",", "%%%"}], "}"}]}], 
    "]"}]}]}]], "Input",
 CellChangeTimes->{{3.8866584772849784`*^9, 3.8866584939678698`*^9}, {
   3.8866585812955866`*^9, 3.8866586265941725`*^9}, {3.8866586770950212`*^9, 
   3.8866586864764147`*^9}, {3.8866587324128304`*^9, 3.886658851590108*^9}, 
   3.8866588995784006`*^9, {3.8866589362990894`*^9, 3.8866589782106714`*^9}, {
   3.92250453372312*^9, 3.9225045397808747`*^9}, {3.9225045904324236`*^9, 
   3.922504625127021*^9}, {3.923565991748045*^9, 3.923565998823479*^9}, {
   3.9236283212418747`*^9, 3.9236283217620635`*^9}, {3.923628363246643*^9, 
   3.923628390207485*^9}, {3.9236286731510897`*^9, 3.9236286960884404`*^9}, {
   3.923628801739964*^9, 3.9236288104038725`*^9}, {3.926438211350021*^9, 
   3.926438215359194*^9}},
 CellLabel->
  "In[252]:=",ExpressionUUID->"50e5d920-d11c-43ee-9374-503c2bc8bf1d"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"a1", "\[Rule]", "0.3679447991616498`"}], ",", 
   RowBox[{"a2", "\[Rule]", 
    RowBox[{"-", "0.21239007051226888`"}]}]}], "}"}]], "Output",
 CellChangeTimes->{
  3.8866585035996804`*^9, {3.886658617105156*^9, 3.886658627899708*^9}, {
   3.886658677576863*^9, 3.886658689713537*^9}, {3.8866587515347695`*^9, 
   3.8866588553407865`*^9}, 3.8866589020140624`*^9, {3.886658955832726*^9, 
   3.8866589882214823`*^9}, 3.8877714505113387`*^9, {3.9225045187921762`*^9, 
   3.922504540580937*^9}, {3.922504603059846*^9, 3.922504625771951*^9}, 
   3.9235660019026155`*^9, {3.923628303109193*^9, 3.9236283225858326`*^9}, {
   3.9236283642504373`*^9, 3.9236283906042414`*^9}, 3.923628699605809*^9, 
   3.9236288109685593`*^9, 3.9245830470607243`*^9, 3.926438216333585*^9, 
   3.9270856440761237`*^9},
 CellLabel->
  "Out[253]=",ExpressionUUID->"79737688-f412-45b6-b3d5-84062dab4c23"],

Cell[BoxData[
 GraphicsBox[{{{}, {}, 
    TagBox[
     {RGBColor[0.368417, 0.506779, 0.709798], AbsoluteThickness[1.6], Opacity[
      1.], LineBox[CompressedData["
1:eJwtlGs01HkAhm3ZTUq2sCahJFLRVmpopZdDR1FoRJKVe2qFPUXZZLFTLkXF
jJVcMoyUeyGr4ecW80+dikYu4zYuM/yr7agmW6m15+yH9zznOc/3V883lBUw
T0FBYd/c/qPBo6UJ165RpOVR/pvDDiJ4cCaDOVyK5ERWpy1yFCHFs2n/5asU
iTBsZ953FkH+MmzF+USKbIiZitJyE6FN5WlZWCRF0k03L+z1FiHQKUVkd4gi
oZkNem4RIhR1KuvLGRRZHdTLcs4Twbh3fgMrQ0hi5qtW234Q4fRA6Oujse2E
z1G0zq/shoOp4cBMVBtptGNrFR15gasCZg7/3AMyyx5Vt1HugZZl06GyoFZS
rP2426WlBxtV07u2BLaQfd1WE8phvWD3jNmpOTaTg1M768029GGvKDlF1aKJ
xCVoV3+U9CFHPzYt/qdGUrqb/dEvpR8BnWKDe7sbiJVfxAKb3WLwFPbmuVkL
SHvutI/wvRgt3NAmE9s6EhnoODCaO4Bjy+O7BStqSWr81lXh7oPQtzINsmHU
kOyHBRUlikPwde16HTt5l6gH5Sp5kCFceLZWa6a1kvS0CxodLYZxdkSP3ZFU
Tm69fJ3fcmUY7z731/+wrZgU7pw4fvLVMLhe5I3zupuEl8dzl9uMwDo7SeVT
G490bl6zvipvBL+4nJMaTWeRZfEai+tnR1AwY1a4fYpD3F51qF9zkUBSzv71
wPEE8jDG7puKCgnMl5yTS5zCiLlBgnrmglHo3L7q+mx1KJpSzM2feI5inuxo
dKZaIk4ZlAF/jSLE0M/H9zoHxo9lJ+JUx9Ce01yu6ZGNZTzZ7wonxiC0LNr2
4QMPyjvceZRwDIoTuzLfzhRigfQSHaA7DmblJ/UY52JsJBcYlmfHYcVMSNfx
KsfBol3B0mfjaJS7SvnFlUhzO/VUbDiB/tGTS8533cXXzUEMlT8mIDGZrQ3u
rkaYrl78970T8E9MDclSrIWSeW6vI1OKTuu0m89V6lDiK2F5J0vhmTZkIVos
wGEWVyyQSOEjN+vXMWuAeaiK/QHIsK5/NtpMtxE62faDDVwZhlrGNdjMJpjM
7HXzfyuDfuTJvqo9zXBlkMEDTpMYENcMH7NvQfgeeTKDPwnXPTEvm71bQd2c
XqU5bwo2/l+33/B/AAPNqj6Z+xQaHNZU+/i14aLDeMG3ZVOQWzzZ1n66HXql
/ayflWkU9P04UxEpxP2Vf65N8KZx3Dc0c1O0EBYalTIlXxqbpsp2VMQJQZQ7
biX60RD8YxJbfnHO33/ZcDGQxnOGsXJZthAdHYGbUoJpKB400i5uEqL/NHM7
5wwN/65VVvyFFGaeiOxvXKGx/rC3ZM0SCmce/L1IL5XGG0kuu2AZhU91Cx/n
pdGImtal8ldQ+My3dMpPp8FZqsPimVBQiuK7FGbRaHVa7p+7nwLDKNyzpIhG
0gv371a6UcjQuaxjcpuG85GMohyPua52a7C0mIY4RPNVth8F7S9i7/IyGu+S
NSKywikYPbcNuFNFo07DlaH9GwU+5WVoWkMjJptTdz16rpMz0rv3aCwuVfua
GU/B+HbJseo6Gp1bXfK0LlEoz21bzxTQyBCk2mReobCFO0zX1NPwsu0cX86l
cCfpY4kZofH/f2FLjHpIbSONfwH7uXxw
       "]]},
     Annotation[#, "Charting`Private`Tag$79193#1"]& ], 
    TagBox[
     {RGBColor[0.880722, 0.611041, 0.142051], AbsoluteThickness[1.6], Opacity[
      1.], LineBox[CompressedData["
1:eJwt1Pk/1HkAx/HpeOjYiCS3VUS1dBAq2bdSW6FcSdmSpEO5SmWziJoQyzp7
yDHKUcpGHqRZD+tjxmC+rQ6jkWOMme/Md62oR9djYtWjnX089of34/V4/gPv
pSFRvsdmslis3er91+XdOmk3blAkvHPRDPOnUgTmj4XnF1DkJypRQ+uZFFkH
eT6/5lAkqfvVN5/VVk1EG1+9RpEMEX9Jf48UnZrPa6MvUqRSetYmWyzFca8s
8Y4DFBGrRAGsYSmqRfMtVAYU2WydVysbl8JmYFarb6GQzEzTPXhr3ghih6Pe
nEjuIme5c7Qt3UfgYW81PBnfSfQSNh0KThlBTosjpyqhg+icc1kdyRuBkQvv
QO1JAflnwvC3VpYMqxde77U73k5Ypxo1K8xkYPcrd+ju4ZNYjtB4LmTwFGdm
LXTmEfMJwbg4SAaORXJe6qY2MnIlOC0pXoZjIsnyRztbiXbv+Z6aEhnKWZ63
9m1pIX7hq0YbmmVoL4ji2W5rJl1mXa2W/TKEGab2tRhzSUPa8NYlkzJYuNqf
dDNoIjWb8/KUenKE+Pe+SR5rIEbV/Gx7RzlSeqyNJgX1hNgMeo37y/GzfCn7
z/Q6cm46e+hSjBwfPw/9scShhuQm83QL8uQoCCJvvVfeIU98cgxS6+XYUpqu
Od1ZTuIHBqmpHjlO+yWMrnhfQgLiFriI38lROel0e+OrfLL72HB85kIadB37
zN5TaaRhzoqwzjU0NmglqGivaGL1UWeZZDcN03s5/j3LoiCeUpQEnqYx8+8T
iUW61/CuaY3gQAaNSKujR0KK82HVasR1uEuji8Ov0w8shSD+0v5ciobQpdrh
06dy3Njb3RwwRmP2X9uLPkzeRvIF7tiUhgKO9dOLk7xrIPUy6zCxVsDVMe26
aVAdPGMsIky2K9Cm8h+tqqnH6zrtl+wQBYYUMVpXexswqzL2dcRlBWjbL9zw
voewohOe299UIPRabmTJbC7Iyy+H49oUEG3Ju/NCsxmn9U1bSqUKHMwbcRYv
aIF7tOXgys8KHFE5DZk6taIkqarS0USJlUNfEp3M2jBjqMPZfJMSI+2MHtuR
h/6Jw5fSA5WwuBgz2LiLD4k+zT4Up8SwpEkW5t4OVuasAM1CJfx3JU3wgwXI
+Z0jduEq4Rb6dePN0A6sXjtg7tGnRKuH5cMjRzsxt23alvdBCZXzM4eu2C7s
mVM4+kiXQeXgmskHF4W4V9gbkbGOwamQqKK1iUJEGE8Va9sxWPuqdvODy0LY
cMweF6jdMmWbXJchRG1FmNVNewYvDGzm15YKUV/7VdrowGB2wAqTGp4QXMF3
3tKNDEJ7zV2r5lHoenvFbt1WBqt+DKYttSikxNwNblL7LV3GrlxEYafqaZaz
G4P492ZUhTGFx9OG49u3McjXMfUtt6XwVONBReAPDARehqFlPhREJpLFbHcG
6S/3a3y7j0J+2Qy3eR4MvA8XVnMCKfgtsz6TpbYkUv916VEKYuuzTwo9GXzM
1LtQcp7CgN3clPt7GDTr+RuYxFEofmjbaOfFIKk0v7k4kULgBj/6kdoL7ut+
LUqlIHHhfM/3ZiBa73fL6BcKZW3t4Tt8GBS25LoVZVMIchsr6lY7aJuIMSyg
YN6pRfn4Mvj/v6DYuf5Tn9r/AuEjfVA=
       "]]},
     Annotation[#, "Charting`Private`Tag$79193#2"]& ]}, {}},
  AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948],
  Axes->{True, True},
  AxesLabel->{None, None},
  AxesOrigin->{0, 0.33272455692276653`},
  DisplayFunction->Identity,
  Frame->{{False, False}, {False, False}},
  FrameLabel->{{None, None}, {None, None}},
  FrameTicks->{{Automatic, Automatic}, {Automatic, Automatic}},
  GridLines->{None, None},
  GridLinesStyle->Directive[
    GrayLevel[0.5, 0.4]],
  ImagePadding->All,
  Method->{
   "DefaultBoundaryStyle" -> Automatic, 
    "DefaultGraphicsInteraction" -> {
     "Version" -> 1.2, "TrackMousePosition" -> {True, False}, 
      "Effects" -> {
       "Highlight" -> {"ratio" -> 2}, "HighlightPoint" -> {"ratio" -> 2}, 
        "Droplines" -> {
         "freeformCursorMode" -> True, 
          "placement" -> {"x" -> "All", "y" -> "None"}}}}, "DefaultMeshStyle" -> 
    AbsolutePointSize[6], "ScalingFunctions" -> None, 
    "CoordinatesToolOptions" -> {"DisplayFunction" -> ({
        (Identity[#]& )[
         Part[#, 1]], 
        (Identity[#]& )[
         Part[#, 2]]}& ), "CopiedValueFunction" -> ({
        (Identity[#]& )[
         Part[#, 1]], 
        (Identity[#]& )[
         Part[#, 2]]}& )}},
  PlotRange->{{-0.2, 0.2}, {0.33272455692276653`, 0.8672754430772385}},
  PlotRangeClipping->True,
  PlotRangePadding->{{
     Scaled[0.02], 
     Scaled[0.02]}, {
     Scaled[0.05], 
     Scaled[0.05]}},
  Ticks->{Automatic, Automatic}]], "Output",
 CellChangeTimes->{
  3.8866585035996804`*^9, {3.886658617105156*^9, 3.886658627899708*^9}, {
   3.886658677576863*^9, 3.886658689713537*^9}, {3.8866587515347695`*^9, 
   3.8866588553407865`*^9}, 3.8866589020140624`*^9, {3.886658955832726*^9, 
   3.8866589882214823`*^9}, 3.8877714505113387`*^9, {3.9225045187921762`*^9, 
   3.922504540580937*^9}, {3.922504603059846*^9, 3.922504625771951*^9}, 
   3.9235660019026155`*^9, {3.923628303109193*^9, 3.9236283225858326`*^9}, {
   3.9236283642504373`*^9, 3.9236283906042414`*^9}, 3.923628699605809*^9, 
   3.9236288109685593`*^9, 3.9245830470607243`*^9, 3.926438216333585*^9, 
   3.927085644457287*^9},
 CellLabel->
  "Out[257]=",ExpressionUUID->"58f282cb-5da6-4403-86e0-e25cbc44d809"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"param", "=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"c", "\[Rule]", "0.15"}], ",", 
     RowBox[{"\[Gamma]", "\[Rule]", "0.25"}]}], "}"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"FullSimplify", "[", 
   RowBox[{
    RowBox[{"ProfitRBunconstr", "/.", "param"}], "/.", 
    RowBox[{"k", "\[Rule]", "0"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"FullSimplify", "[", 
   RowBox[{
    RowBox[{"Profit1Seq", "/.", "param"}], "/.", 
    RowBox[{"k", "\[Rule]", "0"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"FullSimplify", "[", 
  RowBox[{"%%", "-", "%"}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"Plot", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"%%%", ",", "%%"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"d", ",", "0", ",", "0.1"}], "}"}]}], "]"}]}], "Input",
 CellChangeTimes->{{3.926560978039486*^9, 3.9265610321979465`*^9}, {
  3.926561067768669*^9, 3.9265610873374033`*^9}, {3.9265611242844667`*^9, 
  3.926561127648455*^9}, {3.9265613709649305`*^9, 3.926561384274444*^9}, {
  3.92708585627775*^9, 3.9270858772330914`*^9}},
 CellLabel->
  "In[273]:=",ExpressionUUID->"09304e1c-4e07-45ac-94bf-2e4c29771280"],

Cell[BoxData[
 RowBox[{
  RowBox[{"-", "1.6653345369377348`*^-16"}], "+", 
  RowBox[{
   RowBox[{"(", 
    RowBox[{"3.3306690738754696`*^-16", "+", 
     RowBox[{"0.6916679531805725`", " ", "d"}]}], ")"}], " ", 
   "d"}]}]], "Output",
 CellChangeTimes->{{3.9265610089973516`*^9, 3.9265610327589674`*^9}, {
   3.9265610748811464`*^9, 3.9265610876274147`*^9}, 3.9265611282916517`*^9, 
   3.9265613857404404`*^9, 3.927085644546028*^9, {3.927085869522784*^9, 
   3.9270858802100925`*^9}},
 CellLabel->
  "Out[276]=",ExpressionUUID->"f0a53d2c-6629-44f9-ac33-e3b0f28e6604"],

Cell[BoxData[
 GraphicsBox[{{{}, {}, 
    TagBox[
     {RGBColor[0.368417, 0.506779, 0.709798], AbsoluteThickness[1.6], Opacity[
      1.], LineBox[CompressedData["
1:eJwV0Hs0lAkYBnAmklzqaMQMtU3JGcSx2jMV6kGTVSJUSFoSKV3QDlqLVDYc
5LKRTEqUW9IMMj6FHNRpROv7vukioYuIjYOkpOy3f7znPb9/nve8Dy8g1COI
paSk5MLM/7twmBB1JPI2Cd2GFrLMFAhh6d6vYiuhN+iMstRUgc/60ZJ09mIY
CPpm/BjbXq/gx7FXIHb+66kGEwX6PrQFRrAt0X9QVSuar4A0lWSFs+1gbNzV
NLFaAW7v867jbDfcviJa936FAp3zfYljbH9UR40cVyxVgP3aZU9acxgMfTVc
+coKhFuJ36oOnITw36gHnI80lotSPj4JjQf3iMWg+AWNmfD9cxUtCQgYat9W
2kqj0kRbX9yRBGeb6A4nKQ0vFcqRY5GGsLmg0JjLNMRJekvZDRnQ2ahuKEyi
MT1iqWnUmIXBGWpNdgSNTn9PrZjhC3DqKA9I2E8j02ows2c8Bz/k1QnTrjTC
8lvCVcdycSI3uXnSloacU+EbqSeGmSzsba4JjcWTc/Ixbj4EPT1xMj0aXa/8
hNKtVzFt6K9IVKHxTPJX6jJZAfiCmuJ34xRseZl172uvYa/UapOkn8K+vJXD
Ox8Xout91/n1nRSmmg/v2/KkCMU70n42baDgPCF42j14HQ80So69LqdgMVYW
s+vbDWQ3u8ytuEThXB4Z6DFbjAcFf65qSqJw2fW0xyedUpxrLBoxj6LAlw6c
5uqV4ZbFp/apgxQc+sd6jZaWI2V4iZaNFwWOfrw9ZXoTxYeVZHsdKQT/aBtQ
Na9A9v57yu0CCr9/zEzvEd7CUS2r9OXGFDTL5gVf9KpEh/RL74QuBe4Ss/in
XrfBi0zS01CjMOlw9EmPQII3dGm2zjSJC1T+qYw6CZ4Wcs95D5GI2VboWLtO
Ckpt1JndTaKl7fDiymYp+Il+bLmcxBZ9zW/BDlWwcfHuq75HYnVo+NBkRxVm
IlLiC26RsMuXfrZ3q4ZfamzJ3askCqWtBqx/qpHvfyLRKYvEAXne5gs+NTAN
tFd7e5aEX71z6tDLGlg/lGdciyRRX9n0TPvQHZwJY+VGHiLhmzzfumT8DjL5
tnfv+5DYYMNvUD5RixqrODMjVxKicc3NFt9rkSjV4ZXZkRiOe/zB8JQMmTs6
h+1/IVEy8VtJ7A8ZSnMe9Qr5zD8hNcGSpDq4cSc4IgMS3Pp3TjfUCZj0t9dU
LCLxPVaFO6BBwHvB1tMnGffbG40YaRNQtrZxFzIufnQg7boOgVYi7ttLbRJr
X7zpKjIgsNDszB8ajLd/6fcpNCeQR0cbHNEkESt4dfSqOwH55rXTa9RJ+M/M
buzbScBd7G71dQEJYaPhop88CXjMvgtrY7zQ0Vd6xYfJ7w75so9xzu6XU/kH
CISoT1qmq5GoFL2IuxxBoM586tcJVRKZ67/u6IkiMGIYWN/IWDSrzzOMJpCr
62SZwtg6wbtFHEcgYFWosRHjh38/UxMnEpBJNth6qpAo95p+3p1MoGnETb6S
8XkDvXJuKgEHy1d7x+aR2FXkuT0vg7mn2JWcxHhdcOSy7iwCNwV2q3cz5prl
jHKyCXCuFbTyGH8fvdO05yLTl25k8CiL6a9KkXHpEoGgrPtadxn/B/64WJE=

       "]]},
     Annotation[#, "Charting`Private`Tag$84721#1"]& ], 
    TagBox[
     {RGBColor[0.880722, 0.611041, 0.142051], AbsoluteThickness[1.6], Opacity[
      1.], LineBox[CompressedData["
1:eJwV0Hs0VAkABvAxlU7tZG3NzoxJYldW0eNkDwp9KbQ9PFJRIoSltsVk9MLo
QXEQU0N5FyKanQx5XCeslbPHLHHvnQmlorJJ4aBQKXv3j+985/ffdz6jw2Hu
QWwWi+XM5P8uGCLE7ZeMNm1zG1zINtPgKPv7Pyu4LEQkdrCUqzSYFJwpT+Xq
Ir1zybQvY9siuamEa4i6hMqh+pUaPH/TEhjJXYeUG659p001UCZTbBF3M5xD
P3HGV2ggfNZNhnLdYHNeeOyloQYPtb2J37l+aE+Ks1fxNOD2Ox9IaQpHks2J
pimWBqL12S/nDZxCXFhsjuKdGgbipOGOsLMwDD+1oL9bjU8i/1l5cxyCArsW
S5rVUKzUEWS3J4ArSdqRf1cNz7m0k96aFLCDP0vWZqmRncDncevTEG2xfcw2
Xo2pt+s4xg1X0MCydmwVqfHQz2NR9JAMP0bJ5qu81ZCufy3tHcuA/ajhtNN2
NcJzm0XzRq9DZV3aaGOphkpP7n2Cnw3aucehzEgN3YlZ1agwF12J6ztSddQg
n/o6KLfno+b9UfHERxpd5fHJy2puYMTFO7tzgIatkbT23+qbkFlJJMtpGj5Z
PwztaSvAq3+8hsYaaHxoOuLj2FGIjsOv/CzkNHaOWz56/LoIP8/89tfMNRpr
Rkuj936+hXfHL2TaxdG4mEUFus8Ug2/taD4oopHjcs79/eLbCGXzDAwP0TBV
DpwT8kuxkj/Ka9xJY0vf6DNjXhn0tbj6nRto6AnO2tOr7iDQop+MMKER/LVl
YN5qOR46+wec5tKIGJam9jr8AZNUxVyeFg1O6Zzga54KPLFr8jEZoSBcYnb2
kedd5Mux7WovhYktxzp6Lcsx/LKlPKeVgozOjU2rLUek+5zp2RoK0TsKnKqt
lKjUz5WSxRSaW47oKpqUuCzV+uggo+Ao4HwO3lKByOALvEUXKKwIEw1OtFdg
v8sjn6hwCptzlZP2bpWwSY+4ZeNLoUD5YCm7sxKKlttWIS4UAlRZW2Ve98AN
K9m22ZaCb93O5MEn96C8uGtVkBmFOkVjl05IFZaI2t9u0KPgnai9sWSsCiEH
9Yui51PYYGNar3W8Ggdnovq1p0iIxzhb13ypRrTl7nCnARJDkrY3+rE1OHJz
d6dKTaJk/FBJzNcaFLP2NdY8INF89F5weUItxmdHXX0rSQjrXv1yawGBfar2
S06FJL7EzBUOfEPAXxDT87WARJ+98VtjHQKh8f3mNYyLWwNSihYTSLnf2v0T
Y4ueF2ThUgK9eXzHBTdJ7Jru8ypYTaDWojSsLY9EjOXTY/m7CRzPK+TszSLh
92nG7vkeAqVtkzIOY4cG/W+XexB4oTdr0JJJYqGTtzLPi4DHd2utLRln7Hvy
ITeAgJuYEyu4TkIh7pHkRBKIW1h/6Gk6Can1R9fekwQ6TQ+zMxiLZwRG+mcI
GPx6v8SF8ca4/c3ZEgINdmlTjTISf1/tmp99icAi/6o7BVdJlHlOdT9OJBB4
co7PQcaXl/LLhMkE6uXaulzGews9dmWlMfvF5lHxV0hYBZ9Y9vgKgQ5tV4tN
jIVmGSN66QTMa02GJ6XMfyNVjQeuEUhOqLx9l3FfhSYtM5PAu5MfgkIY/wci
fWMQ
       "]]},
     Annotation[#, "Charting`Private`Tag$84721#2"]& ]}, {}},
  AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948],
  Axes->{True, True},
  AxesLabel->{None, None},
  AxesOrigin->{0, 0.2744999881450656},
  DisplayFunction->Identity,
  Frame->{{False, False}, {False, False}},
  FrameLabel->{{None, None}, {None, None}},
  FrameTicks->{{Automatic, Automatic}, {Automatic, Automatic}},
  GridLines->{None, None},
  GridLinesStyle->Directive[
    GrayLevel[0.5, 0.4]],
  ImagePadding->All,
  Method->{
   "DefaultBoundaryStyle" -> Automatic, 
    "DefaultGraphicsInteraction" -> {
     "Version" -> 1.2, "TrackMousePosition" -> {True, False}, 
      "Effects" -> {
       "Highlight" -> {"ratio" -> 2}, "HighlightPoint" -> {"ratio" -> 2}, 
        "Droplines" -> {
         "freeformCursorMode" -> True, 
          "placement" -> {"x" -> "All", "y" -> "None"}}}}, "DefaultMeshStyle" -> 
    AbsolutePointSize[6], "ScalingFunctions" -> None, 
    "CoordinatesToolOptions" -> {"DisplayFunction" -> ({
        (Identity[#]& )[
         Part[#, 1]], 
        (Identity[#]& )[
         Part[#, 2]]}& ), "CopiedValueFunction" -> ({
        (Identity[#]& )[
         Part[#, 1]], 
        (Identity[#]& )[
         Part[#, 2]]}& )}},
  PlotRange->{{0, 0.1}, {0.2744999881450656, 0.33074999871428584`}},
  PlotRangeClipping->True,
  PlotRangePadding->{{
     Scaled[0.02], 
     Scaled[0.02]}, {
     Scaled[0.05], 
     Scaled[0.05]}},
  Ticks->{Automatic, Automatic}]], "Output",
 CellChangeTimes->{{3.9265610089973516`*^9, 3.9265610327589674`*^9}, {
   3.9265610748811464`*^9, 3.9265610876274147`*^9}, 3.9265611282916517`*^9, 
   3.9265613857404404`*^9, 3.927085644546028*^9, {3.927085869522784*^9, 
   3.927085880275855*^9}},
 CellLabel->
  "Out[277]=",ExpressionUUID->"607f9684-b0db-49c8-9610-695ac60cfd6d"]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
   "Now", " ", "we", " ", "conclude", " ", "by", " ", "calculating", " ", 
    "the", " ", 
    RowBox[{"leader", "'"}], "s", " ", "profit"}], "*)"}], 
  "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"P1", "/.", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"q1", "\[Rule]", "q1ind"}], ",", 
       RowBox[{"q2", "\[Rule]", "q2ind"}]}], "}"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Integrate", "[", 
     RowBox[{
      RowBox[{"%", " ", "f"}], ",", 
      RowBox[{"{", 
       RowBox[{"\[Theta]", ",", 
        RowBox[{"-", "d"}], ",", "d"}], "}"}]}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Profit1Seq", "=", 
     RowBox[{
      RowBox[{
       RowBox[{"%", "/.", "tmpseq2"}], "/.", 
       RowBox[{"a0", "\[Rule]", "a0tmp"}]}], "/.", 
      RowBox[{"solseqtmp", "[", 
       RowBox[{"[", "4", "]"}], "]"}]}]}], ";"}]}]}]], "Input",
 CellChangeTimes->{{3.88682552124506*^9, 3.8868255357929697`*^9}, {
  3.886825645691953*^9, 3.8868256505571456`*^9}, {3.887080175243264*^9, 
  3.8870802114075317`*^9}, {3.8870802991948323`*^9, 3.8870802998287783`*^9}, {
  3.9225046423928947`*^9, 3.922504651662341*^9}, {3.9235660144496307`*^9, 
  3.9235660302036285`*^9}, {3.926525444816164*^9, 3.9265254472265773`*^9}},
 CellLabel->
  "In[278]:=",ExpressionUUID->"c59beceb-ea14-4e09-b482-be019080638d"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"Profit1Seq", "/.", 
    RowBox[{"\[Gamma]", "\[Rule]", 
     RowBox[{"1", "/", "3"}]}]}], "/.", 
   RowBox[{"c", "\[Rule]", 
    RowBox[{"1", "/", "5"}]}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"Plot", "[", 
  RowBox[{"%", ",", 
   RowBox[{"{", 
    RowBox[{"d", ",", "0", ",", "0.4"}], "}"}]}], "]"}]}], "Input",
 CellChangeTimes->{{3.926525465809239*^9, 3.9265255295986495`*^9}, {
  3.9265255662433414`*^9, 3.926525675756178*^9}, {3.9270860111756134`*^9, 
  3.927086026240799*^9}},
 CellLabel->
  "In[285]:=",ExpressionUUID->"c59d1043-bb95-4c00-933c-21b8cb991920"],

Cell[BoxData[
 GraphicsBox[{{{}, {}, 
    TagBox[
     {RGBColor[0.368417, 0.506779, 0.709798], AbsoluteThickness[1.6], Opacity[
      1.], LineBox[CompressedData["
1:eJwV0HtUjAkYBvBRaDdJ2qFpCrUnbUgIoeiR0pJabdHogigbIyo7yaUboVqh
KKWk3NJNp6G7TTf5Zqaaaeajvq8LhXQhXdHm0n7+eM97fuc55/nj0d/r57RP
icVi7WLux7/VVypoiLSy1OAPDhp5kOArzap8wNZDwWaP8enuJD5xTuRfYi+F
3pxqzogribV3co1C2euxI+1kfDmPxMveWu9AtiOcZmZEOjuTEMYolALYnvDM
oTwi7EhwX1Dyw2x/jBQXVA+vJiGd6lF6iB2OWtNNwRqzSbA7HVwvVMXicZJv
3YU6BQJMU15P6UrCsME7692RCswVnO+X+aVDw3Prl2cbFRgP2DORW3MH1SXW
nqYsBfIWqHNSGjKR2cd1iq+UgzeZtNU2uY/3F2Zs1A+RIyVKaza7PB9RyltN
fNfK8fndUjWDxw9g9ypKlz9JDqmny/TgvgJ4n2qvf1vdiDjT7ri2oSIU21Kj
76Mb4Z9aEzBloATndwSO7XRuhEQ71+Oo1iOUHev2TdNuhMbIhGSAW479D3vf
rZTIIG/fbSPcXAFBkNxwm7sMzflnY+YUV6JTXc/r5JAUa/XjSt4WVUFJ6/4i
QZwUO5N/7XOur0aC24CRhbEUH6sO7Nwoq0GRpRYZ3tiALcNmTS3dT3Dx0a54
Hf8GmAxkBW/7Ugv6gxcvnN2Ac8kKb6evT5GwJMK/sqoe1/845TSqKYJBYuHB
b/x6GAm7TnG1xCCPC0OqdeuxoWPghcFsCZw/iDVzFHXQ5oRbkQvr0DvLa+mK
s3Xw+V7bNWVxPdLMC3kZqMPf/XGX2mwacOb+eDQ+S6CWpeyTyJOCTjBMX/JQ
Au4vi8KbeDLsLOa07TsqwcgGX1mbWSOSHV8G8VdJEE+mhsWWNGKf7cGVeyfE
CLa7ZVu0So6AsVapap0YNbUHNPKq5KjaHDxmkCDGRo7aF58NCvRtys66sk+M
+X4BPSMNCthUnp4+vkKM9anCT1aOJO7ZDsbvURXjlvCJjlIjiaHQJ2EWr0Xw
kiRbx7s9Q1NOlprwkQi7y7bE9LQ+Q3ER50DUNRHK8iqa1fc/h6qK+/zTQSJ4
RE81vzf0HNyrgf/qu4qwxsKofNKRJhjFGI+FQQTBkJq1ybcmuHTGLss0FKEv
tL5XN6wZvgU9by2Yne8N77oX8r0Z00afzpexRIja5Hkkg0Wh28RreTTj/Tf2
rJMpUVAb5gdYMzay8yb1VBjPLA8tmSCQffPARM0MCroPDr64851AnqOAp6pP
wT18WHjuK4HCvGiVRGsKiQ4ZWYfHCNTwC3zyoyhkZme0ygYJsIzXWBT8Q8Gu
h+64xtiyv1y9JIbCJRszDW/GJX5EYUUsBR1Xfv/YANMvaFGWJVH4PlRx04Bx
UigrvT+TwrbXesMR/QQOX7anFoopTHpSumxvH4FcZ3mOSR2FtCaN4GWMe9ku
YaYNFN6oxA2yGHsn7jY0l1M49FRtR3ovAdfrRwSbaQrbHw7pdfYQsMlI0tjf
S+GufUAyv5sAt+zNprs/03AK+d049Q2BbyGTuV3TaFgJFwt9GXdYGbwzUGfy
k6n8tYwzxF4X7mjSeCTXPtn2msBy+pX8tg4NceRZzXmM7cc63G4tplHEWaCT
10kgxKzdN+1PGurS9CsjLwh4jn9d99KZ6a8tzRIztnmsO2OeC41LTh6jaYxV
bT2EN9xoCJZY/ubA+Or21o+pXjT8hgXK2e0/9qJDrwfScEzNSzjURiBu9X9b
24JozP3kOWrLWPCVo697gsZPXdcj9Ribn9lRkxJKw/iscMuzVgLElWaVlEga
2VIHO0vG2bzPVEs0DVvK3kGb8UUdrWxuDI3xoOdnRlsIbLvtYp8cS6PqeERc
DuNVPkfntFymIWnN/CuSMXfR1Q/aCTQGSJ6/F+NvHworXBNpGO6NzQPjjgfP
Y69do3HsnJO+LuP/AfYABWc=
       "]]},
     Annotation[#, "Charting`Private`Tag$92990#1"]& ]}, {}},
  AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948],
  Axes->{True, True},
  AxesLabel->{None, None},
  AxesOrigin->{0, 0.1863436854082925},
  DisplayFunction->Identity,
  Frame->{{False, False}, {False, False}},
  FrameLabel->{{None, None}, {None, None}},
  FrameTicks->{{Automatic, Automatic}, {Automatic, Automatic}},
  GridLines->{None, None},
  GridLinesStyle->Directive[
    GrayLevel[0.5, 0.4]],
  ImagePadding->All,
  Method->{
   "DefaultBoundaryStyle" -> Automatic, 
    "DefaultGraphicsInteraction" -> {
     "Version" -> 1.2, "TrackMousePosition" -> {True, False}, 
      "Effects" -> {
       "Highlight" -> {"ratio" -> 2}, "HighlightPoint" -> {"ratio" -> 2}, 
        "Droplines" -> {
         "freeformCursorMode" -> True, 
          "placement" -> {"x" -> "All", "y" -> "None"}}}}, "DefaultMeshStyle" -> 
    AbsolutePointSize[6], "ScalingFunctions" -> None, 
    "CoordinatesToolOptions" -> {"DisplayFunction" -> ({
        (Identity[#]& )[
         Part[#, 1]], 
        (Identity[#]& )[
         Part[#, 2]]}& ), "CopiedValueFunction" -> ({
        (Identity[#]& )[
         Part[#, 1]], 
        (Identity[#]& )[
         Part[#, 2]]}& )}},
  PlotRange->{{0, 0.4}, {0.1863436854082925, 0.3024999955102041}},
  PlotRangeClipping->True,
  PlotRangePadding->{{
     Scaled[0.02], 
     Scaled[0.02]}, {
     Scaled[0.05], 
     Scaled[0.05]}},
  Ticks->{Automatic, Automatic}]], "Output",
 CellChangeTimes->{{3.926525454789198*^9, 3.9265255194529247`*^9}, {
   3.9265255616855497`*^9, 3.9265256596804*^9}, 3.9265256946344104`*^9, 
   3.9270858438672857`*^9, {3.927086009316886*^9, 3.9270860273163757`*^9}},
 CellLabel->
  "Out[286]=",ExpressionUUID->"aea2e72e-b394-4043-8268-c9c5da27d4b8"]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["The figure comparing the profits in the three cases", "Section",
 CellChangeTimes->{{3.9235660466758485`*^9, 3.923566050881424*^9}, {
   3.9235702288369975`*^9, 3.9235702443995333`*^9}, 
   3.923623529236867*^9},ExpressionUUID->"e5f1422f-75d5-46c1-8171-\
f3de990f31be"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
   "Now", " ", "we", " ", "obtain", " ", "figure", " ", "3", " ", "of", " ", 
    "the", " ", "paper"}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"paramplot", "=", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"c", "\[Rule]", "0.3"}], ",", 
       RowBox[{"\[Gamma]", "\[Rule]", "0.4"}]}], "}"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"ProfitEall", "-", "Profit1Seq"}], "/.", "paramplot"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Solve", "[", 
     RowBox[{
      RowBox[{"%", "\[Equal]", "0"}], ",", 
      RowBox[{"{", "d", "}"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"dcross", "=", 
     RowBox[{"%", "[", 
      RowBox[{"[", 
       RowBox[{"2", ",", "1", ",", "2"}], "]"}], "]"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"linecross", "=", 
     RowBox[{
      RowBox[{"Line", "[", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"dcross", ",", "0.18"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"dcross", ",", 
           RowBox[{"ProfitEall", "/.", 
            RowBox[{"d", "->", "dcross"}]}]}], "}"}]}], "}"}], "]"}], "/.", 
      "paramplot"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"Profit1Seq", "/.", 
      RowBox[{"d", "->", 
       RowBox[{"Dq2sol", "+", "0.1"}]}]}], "/.", "paramplot"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Dq2sol", "/.", "paramplot"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"{", 
       RowBox[{"ProfitRBall", ",", "ProfitEall", ",", "Profit1Seq"}], "}"}], "/.", 
      RowBox[{"k", "\[Rule]", "0"}]}], "/.", "paramplot"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"FigureProfitsAsymInfoSequ", "=", 
    RowBox[{"Show", "[", "\[IndentingNewLine]", 
     RowBox[{"Quiet", "[", 
      RowBox[{"Plot", "[", 
       RowBox[{"%", ",", 
        RowBox[{"{", 
         RowBox[{"d", ",", "0", ",", 
          RowBox[{"%%", "+", "0.1"}]}], "}"}], ",", "\[IndentingNewLine]", 
        RowBox[{"Epilog", "\[Rule]", 
         RowBox[{"{", "\[IndentingNewLine]", 
          RowBox[{
           RowBox[{"Text", "[", 
            RowBox[{
            "\"\<\!\(\*SubsuperscriptBox[\(\[Pi]\), \(1\), \(MSR\)]\)\>\"", 
             ",", 
             RowBox[{"{", 
              RowBox[{"0.1", ",", "0.28"}], "}"}]}], "]"}], ",", 
           "\[IndentingNewLine]", 
           RowBox[{"Text", "[", 
            RowBox[{
            "\"\<\!\(\*SubsuperscriptBox[\(\[Pi]\), \(1\), \(NL\)]\)\>\"", 
             ",", 
             RowBox[{"{", 
              RowBox[{"0.18", ",", "0.24"}], "}"}]}], "]"}], ",", 
           "\[IndentingNewLine]", 
           RowBox[{"Text", "[", 
            RowBox[{
            "\"\<\!\(\*SubsuperscriptBox[\(\[Pi]\), \(1\), \(E\)]\)\>\"", ",", 
             RowBox[{"{", 
              RowBox[{"0.1", ",", "0.237"}], "}"}]}], "]"}], ",", 
           "\[IndentingNewLine]", "Dotted", ",", "linecross"}], 
          "\[IndentingNewLine]", "}"}]}], ",", "\[IndentingNewLine]", 
        RowBox[{"PlotStyle", "\[Rule]", 
         RowBox[{"{", 
          RowBox[{
           RowBox[{"{", 
            RowBox[{"Black", ",", 
             RowBox[{"Thickness", "[", "0.006", "]"}]}], "}"}], ",", 
           RowBox[{"{", 
            RowBox[{"Black", ",", "Dotted"}], "}"}], ",", 
           RowBox[{"{", 
            RowBox[{"Black", ",", "Dashed"}], "}"}]}], "}"}]}], ",", 
        "\[IndentingNewLine]", 
        RowBox[{"LabelStyle", "\[Rule]", 
         RowBox[{"Directive", "[", 
          RowBox[{"FontSize", "\[Rule]", "10"}], "]"}]}], ",", 
        "\[IndentingNewLine]", 
        RowBox[{"Ticks", "\[Rule]", 
         RowBox[{"{", 
          RowBox[{
           RowBox[{"{", 
            RowBox[{"0", ",", 
             RowBox[{"{", 
              RowBox[{"dcross", ",", "0.24"}], "}"}]}], "}"}], ",", 
           RowBox[{"{", "}"}]}], "}"}]}], ",", "\[IndentingNewLine]", 
        RowBox[{"AxesStyle", "\[Rule]", 
         RowBox[{"Arrowheads", "[", 
          RowBox[{"{", 
           RowBox[{"0.0", ",", "0.02"}], "}"}], "]"}]}], ",", 
        "\[IndentingNewLine]", 
        RowBox[{"PlotRange", "\[Rule]", 
         RowBox[{"{", 
          RowBox[{
           RowBox[{"{", 
            RowBox[{
             RowBox[{"-", "0.01"}], ",", "0.28"}], "}"}], ",", 
           RowBox[{"{", 
            RowBox[{"0.18", ",", "0.33"}], "}"}]}], "}"}]}], ",", 
        "\[IndentingNewLine]", 
        RowBox[{"AxesLabel", "\[Rule]", 
         RowBox[{"{", 
          RowBox[{
          "\"\<\[CapitalDelta]\>\"", ",", 
           "\"\<\!\(\*SubscriptBox[\(\[Pi]\), \(1\)]\)\>\""}], "}"}]}]}], 
       "\[IndentingNewLine]", "]"}], "\[IndentingNewLine]", "]"}], 
     "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"SetDirectory", "[", 
     RowBox[{"NotebookDirectory", "[", "]"}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"SetDirectory", "[", 
     RowBox[{"ParentDirectory", "[", "]"}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"SetDirectory", "[", "\"\<Figures\>\"", "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Export", "[", 
     RowBox[{
     "\"\<FigureProfitsAsymInfoSequ.pdf\>\"", ",", 
      "FigureProfitsAsymInfoSequ"}], "]"}], ";"}], "\[IndentingNewLine]", 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"reimport", "=", 
     RowBox[{"Import", "[", "\"\<FigureProfitsAsymInfoSequ.pdf\>\"", "]"}]}], 
    ";"}], "\n", 
   RowBox[{
    RowBox[{"Export", "[", 
     RowBox[{"\"\<FigureProfitsAsymInfoSequ.pdf\>\"", ",", 
      RowBox[{"reimport", "[", 
       RowBox[{"[", "1", "]"}], "]"}]}], "]"}], ";"}]}]}]], "Input",
 CellChangeTimes->{{3.888041337176317*^9, 3.888041430151735*^9}, {
   3.888041615434107*^9, 3.8880416991390796`*^9}, {3.888041743182774*^9, 
   3.888041779602621*^9}, {3.8880422867973924`*^9, 3.888042302237934*^9}, {
   3.88804233761677*^9, 3.888042387450597*^9}, {3.888042471369991*^9, 
   3.888042571398468*^9}, {3.8880426361201286`*^9, 3.8880427125731015`*^9}, {
   3.8880427552497406`*^9, 3.888042758916196*^9}, {3.8880428234034452`*^9, 
   3.8880430239253254`*^9}, {3.8880430668744493`*^9, 
   3.8880432862634835`*^9}, {3.888043350876808*^9, 3.888043419739783*^9}, {
   3.8880434769246464`*^9, 3.8880434775293856`*^9}, {3.8880435100228596`*^9, 
   3.888043706999914*^9}, 3.888043860663328*^9, {3.8883141378474593`*^9, 
   3.888314137928422*^9}, {3.891661326867354*^9, 3.8916613984356995`*^9}, {
   3.89166159893979*^9, 3.891661684950122*^9}, {3.891661735886259*^9, 
   3.891661746270444*^9}, {3.8916617891538815`*^9, 3.8916618119273973`*^9}, {
   3.8916618448159204`*^9, 3.89166187666335*^9}, {3.891661910738158*^9, 
   3.891661990809972*^9}, {3.891662040751296*^9, 3.891662095371086*^9}, {
   3.89166212852454*^9, 3.8916622204299726`*^9}, {3.8916624273445125`*^9, 
   3.8916624282043495`*^9}, {3.8916625364776144`*^9, 
   3.8916625727984943`*^9}, {3.8916627046768923`*^9, 3.8916627300547123`*^9}, 
   3.891662771519087*^9, {3.8916629223610115`*^9, 3.891662982095745*^9}, {
   3.8916630876272097`*^9, 3.8916631334985576`*^9}, {3.891663218869442*^9, 
   3.891663254837488*^9}, {3.891663298425701*^9, 3.891663326334569*^9}, {
   3.8916633860033264`*^9, 3.891663656467783*^9}, {3.8916643490718246`*^9, 
   3.891664562762247*^9}, {3.8916646119911947`*^9, 3.8916647215880113`*^9}, {
   3.923569753218272*^9, 3.923569834792224*^9}, {3.923569870079549*^9, 
   3.923569942984637*^9}, {3.9235700714032645`*^9, 3.9235700788535523`*^9}, {
   3.923570114803963*^9, 3.9235702049521446`*^9}, 3.9236285881798267`*^9, 
   3.9236286531940556`*^9, {3.9239895687142506`*^9, 3.9239895969521356`*^9}, {
   3.924583043186898*^9, 3.924583044955294*^9}, {3.92708612788456*^9, 
   3.9270861297608953`*^9}},
 CellLabel->
  "In[457]:=",ExpressionUUID->"a7b3921e-1bbd-4e8f-b110-fb5bbf9bc7e6"],

Cell[BoxData[
 GraphicsBox[{{{}, {}, 
    TagBox[
     {GrayLevel[0], Thickness[0.006], Opacity[1.], LineBox[CompressedData["
1:eJwBYQKe/SFib1JlAgAAACUAAAACAAAALI6im7xfNz7DGItdor/TP4tYcVXu
cBU/Q0Le+vG+0z9GIfiVv3AlP4SX86hBvtM/o4U7NqhwNT9DxWQ34bzTP9I3
XYaccEU/wS1hHSG60z/pEG6ulnBVP6kywg2ktNM/dX12wpNwZT8qDCWAtqnT
P7uzekyScHU/A/5tqw2U0z8YLL0hZ1eGP5jFy3L9ZdM/Ssy8l66YkD+wClkv
FzzTP3xFD5Jq6pU/R03JDQ4U0z9L7YFUka+bP8jo5tbK6dI/HXEJEBKJoD8k
BM/6ccPSP+MC4tkQdKM/Ak0/0xSb0j8jtnQdcFGmP11nMFmpdNI/84+WZYX9
qD//YOcW51HSPxKByBFQ46s/7/LRcmMt0j/BmInC0JeuP4wJHtRnDNI/9WiC
9lifsD9vPCJ+G+3RPzERyD2kD7I/3DtiCE/M0T+1TFWHSmezP9s6fyvLrtE/
4JPqgsvbtD+2/1zS/I/RP8jrXLt8SbY/kiXsPvJy0T/41hb2iJ63P/YiNE/v
WNE/0M3Y4m8QuT+tDr6d5D3RP/BX4tGxabo/T8NNdcAl0T+37fNyzt+7P9uG
q2zKDNE/O5TiUBtPvT9xaVz/fvXQPwfOGDHDpb4/6fiz29jg0D+9iavhogzA
P5FPq96jy9A/G3buqxG6wD89aUDq8rjQP9fqn5QYZME/Ns4WD6qn0D9nZVXW
jBzCPwl8u7kTltA/m6kuma7Iwj9c7B7kwYbQPzMzMzMzM8M/PtURHvV90D+i
8wu1PYPDP93qhk9Yd9A/p3UvMh4GxD9vz3CyRW3QP5J0LSM=
       "]], LineBox[CompressedData["
1:eJwVznss1XEcxnGdwrFDnBMOIxQjhrXWZa6Pw5ooijTJnAxdVS5ZzSVtZYaS
6YKppUUsRbGWWy4ZR279Pj9ZU3JJhMIUNpdTp29/PHvv9d+zJSIm8IRATU3N
ju1/B+1T+1+K2lBpuCNs8BxBEtFR7jTRhmnpTfPEMML8epfm5IftaK+pmr0V
QIiP6QuK3q/ALpuie4e9CYGRA8KFRQXyZszDdd0JGmFjBlPPO9BfqYjr2kmQ
W+iVZB19h6if/qf77AmZ07IbhZJOXCl6UTNkRTiakr8Q3NKJpXDnH5pmhPT8
0KSKs10YqyipGpASMmotj8VadsPxDHZViAmOxboNo1w3xk2FFKlNKLujSmjK
6oHv6/NCK03CVW25307PXghbJ3XiBIQ1/9HS4NleaM2ZFo4qOfjmnwyZKn0P
cjWXri5ycHuql20dxOFAo5vCd45DjpftiPIPh+oCyduQKQ6ff23daxHKfnuu
y8se49Bk7TVoVEW4byNLrR3i8Oyv4E1BNWHdQZllCXPBx9YHRq8I3mk9fTnM
cemecqMagm1HUsApZqvvsq/SRkJ28VKPIXPmE49Jw07Cb5Pj9Ze/cAiycl/Q
/0ogP5VcNsjBQ/nnw90xQnTU7CFHZof+xlf644TtOZv9TJg10twu6U8Slve4
RC195lD3zXVl0yzh0WMHnXJms2IXlWSF0Pxe5W3ALEpeG7m9SphMUB8SMC8H
NrRIlISLE7Yp85848AKXaxIV4fwFxUA3c1qEs7pEnYf9PrHoOnOs8+pErgYP
RNF8LHOYpF4hFvIwnn8wKmfe3eqUIRbxSKo9MuzMbFm4cjpXm0dKmdvMNma9
+Dof8UYeftF2G6TMSp9Eu1xdHtojxtbqzNNbnERiMY/SYa3AhQEO/wCx+lPD

       "]]},
     Annotation[#, "Charting`Private`Tag$160664#1"]& ], 
    TagBox[
     {GrayLevel[0], AbsoluteThickness[1.6], Opacity[1.], Dashing[{0, Small}], 
      LineBox[CompressedData["
1:eJwBQQK+/SFib1JlAgAAACMAAAACAAAALI6im7xfNz6T8F2D61HQP4tYcVXu
cBU/gz4Kn4RR0D9GIfiVv3AlPyoTSsQdUdA/o4U7NqhwNT+cUIQrUFDQP9I3
XYaccEU/DhzjbLVO0D/pEG6ulnBVPzH1SbuBS9A/dX12wpNwZT9zsLyGIUXQ
P7uzekyScHU/20o22H040D8YLL0hZ1eGP/mmYbaZHdA/Ssy8l66YkD/9eQlb
IAXQP3xFD5Jq6pU/5HQ5oXTbzz9L7YFUka+bPyHKiGkGqs8/HXEJEBKJoD8q
ol0OJX3PP+MC4tkQdKM/D2ZVCd9Nzz8jtnQdcFGmP2WJISHXIM8/84+WZYX9
qD9rU0mkEfjOPxKByBFQ46s/F/FX9jPNzj/BmInC0JeuP8GET8Nyps4/9WiC
9lifsD94FjbMo4HOPzERyD2kD7I/OSWfOAdbzj+1TFWHSmezP5X/66M+OM4/
4JPqgsvbtD+BmOW/5RPOP8jrXLt8SbY/mKIPgpbxzT/41hb2iJ63P83cYQbR
0s0/0M3Y4m8QuT8alj1+x7LNP/BX4tGxabo/ZZPi4iGWzT+37fNyzt+7P+Pr
Hs91eM0/O5TiUBtPvT/f19aetlzNPwfOGDHDpb4/PcPGyRBEzT+9iavhogzA
PxtKYhaxKs0/G3buqxG6wD86Dge9RBTNP9fqn5QYZME/kOHJRHn/zD9nZVXW
jBzCP09SJKQ+6sw/m6kuma7Iwj9ubRvBrtfMP5nXC+JpMMM/9z4RLBTNzD+w
JhTy
       "]], LineBox[CompressedData["
1:eJwVy31MzHEAx/E6Lrcd1f1cOptxOa6R5I88XKc+PUx2TJGb60H9cS4zrS7N
bJXJUhZRKhx5mClaTyNlpKSlLnXfq9+vGpbo+Wmx5KKnS77++Oy91x8fF60+
JJpnY2PjRve/5qzwNOvO9yhhlKnphEBg1EzqvBphvrA2iaskYLTNJYrhRvCu
Te2fKCT4uUz5LvlhE0qPGyXmWwQJ+g51zEEjvMrTRXkZBCEnPgss00YcPtYm
jzxPYBc54DRW1oyaWlvhoJ4gSupYeDX0A9wmYybGdARXxv0y85kWPLNIw8vC
CELPGyya+hZsi/cZqg8muGyISCo/3QoDf7Q/PZAg47UsPF5mQskjTS3fm2B7
gUNNX7sJPb905Xc9CYryls7WXaW/HLH0uxtBysqoQ57+Zih8OoY7ZAQLQX1P
NT/MCM5/GfdwHcEBw8mwsadtePJt5MQWJwLvYsfrcnU7gioculPtCbIDtvRa
F9tx2/ViZYCAoHtq4z5pBIusx56M0ZagTh7wRVLB4kbdVo/ZBRNK//Jq77xg
4V0mJ9+o73xsuC+pYuGRWBHbRH3msn+U5BWL6g9xdbnUm0b8+p3fshhajL7t
Tn3lie/omhYW99x2bdDNm6De5GMR97PIfzSZ2TVrgq91sfPmAIuZPfrXNdTu
XW+rxEMsYv0144+p7dK8z4lHWRyZiQg9Q109uHdu9Q8WfFfnGHvq9QXKJWaO
xfvxYK1qxgRh8kJv7jyLlKLWrh3UsyE19YyVxbTvvYMSao6nTGWWWKyIVwSO
/jEhTevFZ/gcVFUqfTp1vNf8cI4dh0T/o8tjqSOZN0aRgMOnjOIHaupdDYoM
kZDD78rdX2XUsvy5UzkrORSoYy8JqR0TqlUiew5hmyfcLb9NsKoSt+Y4cFjF
f97TTT3uohCKRBwknW+yG6j/AUEgYh4=
       "]]},
     Annotation[#, "Charting`Private`Tag$160664#2"]& ], 
    TagBox[
     {GrayLevel[0], AbsoluteThickness[1.6], Opacity[1.], 
      Dashing[{Small, Small}], LineBox[CompressedData["
1:eJwV0n0w1AkAxnGnqYSyu2lblWYXZy5XTV3JbNJD3ZbXDq2zqmVuj3RKbXnJ
hW68ns2VvDtc2xHVkYjaY73FJvz25ffbNb2cm6OVik5vWw5xbu+PZ77z+f/h
iE4ERpiamJj4Gfd/11+oKGsNc9mpYGULKzp0yBacDHolXoFndg2Tb9t12MOZ
KuwQf4oxEUo8jK7McN12TeyMhPSC98OtOmhdhJnlYh7e+XEY7BYdxmjH64rE
QbCbUQxLm3SIS47vyhdH4LRsq7Lqug7yxjO+eeI4WPbcHuzP14G1vo0TGZwJ
zjkf98FwHbyVrcV1JRch9rknLeLqkMSzyosaL8TxOfqKBisdfCZS+Lk3yyBp
dOYN6LWwPbmExpBcxmSYSVZqsxYjpvrHtNhK7CaiU/jntbC/E2srDqhGuAt3
KEekhSGnKCJj7hqSBk5XOLtqwUjppfuP1GCm+tcbbLoWd0skXWRxHZwOvY6P
GKfw4UjqpEBaj7q42aB3Cgqb6b1uV6xuwT9Nxh0tp3DbN+hH78hGbHMSmjMS
KAznj6cSg00w8Dx6O/wp9L48JE/yugOSv3Kkw4nC1APmZNYlGWw+XOU/XkyB
VD3Sn6A1gx3I3FCoJ/EmWE81fNeCT2q0nSGdJGQThlPqITmYW1d3D5aRcC3Q
+6/+qg3zF2JSKxNILFazNndXtaNloNZjv4BEm6TmSYVlJzJ8D1jpnUmsjn9V
Q2/pROqQ+0ZPJomH49ICVvhd7PHWhFS91iAyIujBT2u6oFb1mbfUaVB2fePP
db1dSBMGSN1iNKgwWNx2S+uGt+AYOblFA7Oe4Nfh2xWo/zJFsPQfNRii+79x
RxWwLfJPDOhQ480C147ES/ewZXqTz7J0NU6d0PKP+vQgId9D/NBPjcBvH5kZ
3vfgWrfLN3IbNRYJ9Ste1N5HzI6GwyF6FULZtCvnBL3Y7Ja8SXFTBcmYR3Yp
ow/uGTuotWdUECQVG4I7+xDW6Nfv4KVCZvHBMzei+pFcX5uxfpUKWb/bHxDb
E+iXmiojXiixsdJKPqwhkNYYmGMuV+Jq/nxs+zklyn/h/cXMVuIHy1C/rbtU
qA+wvsgVKvFx33B18IQKt14Wh2RuUcK7+HDIi2o1wmwS/0xerITbddp5R74G
R2cf2p0dIpCze93Q7JwG4Z6l9oHNBP54a8djHyRRHRctYuQSaHfcPchqINFE
j5KVHSNQ869pa8ktEvlMke/HowRKHnSVs5pI/J11ZPKA0Sczd4WyZCSW37ks
WRVFwOGZx5OVbSRWfdFeWxpJQFLl/pzZR2K+/sboJREBvsNOg/UTEi79oXYy
AQH32TldgfFH/LMOITZGbxhoa7J+SuKddOpKYjCBRelu8dbPSeR9rkx0/5pA
88iO6eUTJLLC2Y7EfgJrK13nGdMk9guTo5/uI2CR+HEob4bE0rF1H/YaPRUo
72TMktirf5pb40eAMnVNZcyTWGObaR7jSyBdtH0hYyGFvKa4KVNvAuLtM6O5
iyiwaws/i/QiIGS09NDNKHDoimjCk8C2Lm4W3YLCZXtfl4K9BOxLp4/kWlJg
UFXyqT0EaKeavejLKMy/XBokNHrW63unXCsKUbHpC7p4BMY4XAs6nYJn1JL7
jkb/B8UyYxY=
       "]]},
     Annotation[#, "Charting`Private`Tag$160664#3"]& ], {}}, {}},
  AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948],
  Axes->{True, True},
  AxesLabel->{
    FormBox["\"\[CapitalDelta]\"", TraditionalForm], 
    FormBox[
    "\"\\!\\(\\*SubscriptBox[\\(\[Pi]\\), \\(1\\)]\\)\"", TraditionalForm]},
  AxesOrigin->{0, 0.18},
  AxesStyle->Arrowheads[{0., 0.02}],
  DisplayFunction->Identity,
  Epilog->{
    InsetBox[
     FormBox[
     "\"\\!\\(\\*SubsuperscriptBox[\\(\[Pi]\\), \\(1\\), \\(MSR\\)]\\)\"", 
      TraditionalForm], {0.1, 0.28}], 
    InsetBox[
     FormBox[
     "\"\\!\\(\\*SubsuperscriptBox[\\(\[Pi]\\), \\(1\\), \\(NL\\)]\\)\"", 
      TraditionalForm], {0.18, 0.24}], 
    InsetBox[
     FormBox[
     "\"\\!\\(\\*SubsuperscriptBox[\\(\[Pi]\\), \\(1\\), \\(E\\)]\\)\"", 
      TraditionalForm], {0.1, 0.237}], 
    Dashing[{0, Small}], 
    LineBox[{{0.23733621765076446`, 0.18}, {0.23733621765076446`, 
     0.2194802218652984}}]},
  Frame->{{False, False}, {False, False}},
  FrameLabel->{{None, None}, {None, None}},
  FrameTicks->{{Automatic, Automatic}, {Automatic, Automatic}},
  GridLines->{None, None},
  GridLinesStyle->Directive[
    GrayLevel[0.5, 0.4]],
  ImagePadding->All,
  LabelStyle->Directive[FontSize -> 10],
  Method->{
   "DefaultBoundaryStyle" -> Automatic, 
    "DefaultGraphicsInteraction" -> {
     "Version" -> 1.2, "TrackMousePosition" -> {True, False}, 
      "Effects" -> {
       "Highlight" -> {"ratio" -> 2}, "HighlightPoint" -> {"ratio" -> 2}, 
        "Droplines" -> {
         "freeformCursorMode" -> True, 
          "placement" -> {"x" -> "All", "y" -> "None"}}}}, "DefaultMeshStyle" -> 
    AbsolutePointSize[6], "ScalingFunctions" -> None, 
    "CoordinatesToolOptions" -> {"DisplayFunction" -> ({
        (Identity[#]& )[
         Part[#, 1]], 
        (Identity[#]& )[
         Part[#, 2]]}& ), "CopiedValueFunction" -> ({
        (Identity[#]& )[
         Part[#, 1]], 
        (Identity[#]& )[
         Part[#, 2]]}& )}},
  PlotRange->{{-0.01, 0.28}, {0.18, 0.33}},
  PlotRangeClipping->True,
  PlotRangePadding->{{0, 0}, {0, 0}},
  Ticks->{{{0, 
      FormBox["0", TraditionalForm]}, {0.23733621765076446`, 
      FormBox["0.24`", TraditionalForm]}}, {}}]], "Output",
 CellChangeTimes->{
  3.8916628141194634`*^9, {3.8916629232622166`*^9, 3.89166298236794*^9}, {
   3.891663090611472*^9, 3.891663133922974*^9}, {3.8916632191413035`*^9, 
   3.89166325523695*^9}, 3.891663329867711*^9, {3.891663393810649*^9, 
   3.8916634294774756`*^9}, {3.891663460396389*^9, 3.8916635844213715`*^9}, {
   3.8916636160754757`*^9, 3.8916636566624823`*^9}, {3.8916643496408544`*^9, 
   3.891664562945562*^9}, {3.891664638536084*^9, 3.891664646067769*^9}, {
   3.891664680746273*^9, 3.89166472235509*^9}, 3.9224991172807894`*^9, {
   3.923569821877383*^9, 3.9235698358356533`*^9}, {3.9235698711025915`*^9, 
   3.9235699053147583`*^9}, 3.9235699441520643`*^9, 3.9235700798777285`*^9, 
   3.92357011618601*^9, {3.923570157581704*^9, 3.923570205786791*^9}, 
   3.9236284314500737`*^9, 3.9236285896850586`*^9, 3.923628820960696*^9, 
   3.9245830488172245`*^9, 3.927086037798874*^9, 3.9270861315917253`*^9, 
   3.9270869711880417`*^9, 3.927087600905163*^9},
 CellLabel->
  "Out[465]=",ExpressionUUID->"1b535283-189a-41d7-b975-354af6365d01"]
}, Open  ]]
}, Open  ]]
}, Open  ]]
},
WindowSize->{949., 532.5},
WindowMargins->{{0, Automatic}, {Automatic, 0}},
TaggingRules->{"TryRealOnly" -> False},
Magnification:>1. Inherited,
FrontEndVersion->"12.1 for Microsoft Windows (64-bit) (June 19, 2020)",
StyleDefinitions->"Default.nb",
ExpressionUUID->"c962c9bb-4c93-43ee-ac57-1225275f4a35"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[580, 22, 411, 8, 160, "Title",ExpressionUUID->"2d7cdfda-3529-4250-9524-675b0650cc94"],
Cell[994, 32, 501, 7, 34, "Text",ExpressionUUID->"7f4410a6-6137-4b21-adf7-8aeb55c4a1e0"],
Cell[CellGroupData[{
Cell[1520, 43, 166, 3, 67, "Section",ExpressionUUID->"4edc7394-9758-4adf-a6d7-108085b20569"],
Cell[1689, 48, 1053, 26, 48, "Input",ExpressionUUID->"a3d8119a-5ceb-4c29-806f-36c8c9577bc0"],
Cell[2745, 76, 975, 25, 68, "Input",ExpressionUUID->"7e2d0319-45f4-4a73-819a-b523bb0eb15a"],
Cell[CellGroupData[{
Cell[3745, 105, 2099, 60, 165, "Input",ExpressionUUID->"4149c52e-1778-4b47-b488-06b89af439cf"],
Cell[5847, 167, 981, 27, 51, "Output",ExpressionUUID->"c3151613-186f-4d26-98d7-5eb55395f524"],
Cell[6831, 196, 887, 23, 51, "Output",ExpressionUUID->"903d3857-551e-4083-9600-4e50fad45d50"],
Cell[7721, 221, 481, 10, 49, "Output",ExpressionUUID->"45a9edc3-1dbe-40ea-acea-751540766d5d"]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[8251, 237, 213, 4, 53, "Section",ExpressionUUID->"007d19a6-a447-4413-880a-156453aa69ef"],
Cell[CellGroupData[{
Cell[8489, 245, 1266, 33, 87, "Input",ExpressionUUID->"99b2f438-3892-44b5-97b1-572a5ca798da"],
Cell[9758, 280, 868, 13, 32, "Output",ExpressionUUID->"c023fdce-7a4f-48ce-b702-e6f239922ead"],
Cell[10629, 295, 962, 17, 48, "Output",ExpressionUUID->"26406f6f-5294-4cba-ab13-556203088725"]
}, Open  ]],
Cell[11606, 315, 1220, 25, 87, "Input",ExpressionUUID->"ecbb6c4d-6769-4b1c-8a7c-5b5e52f7c103"],
Cell[CellGroupData[{
Cell[12851, 344, 2452, 69, 165, "Input",ExpressionUUID->"6858c079-6ab1-4cd9-a8b9-89b26d56d6f4"],
Cell[15306, 415, 1171, 23, 52, "Output",ExpressionUUID->"e54d8e33-1364-4ab5-992c-e86a1cb8dfb0"],
Cell[16480, 440, 1230, 24, 51, "Output",ExpressionUUID->"53d07c93-a2a5-47e1-a29e-f0fb8a880b29"],
Cell[17713, 466, 1200, 25, 51, "Output",ExpressionUUID->"9719bd79-e8f3-4d20-a606-b1a7647eedd1"]
}, Open  ]],
Cell[CellGroupData[{
Cell[18950, 496, 1317, 34, 87, "Input",ExpressionUUID->"2e9fe6cf-7079-4ce9-ba7c-bb0b0fe0264c"],
Cell[20270, 532, 1137, 26, 50, "Output",ExpressionUUID->"fd5762dc-9756-4823-9982-c95ca64d15fb"]
}, Open  ]],
Cell[CellGroupData[{
Cell[21444, 563, 2021, 53, 184, "Input",ExpressionUUID->"3af8abef-eaef-4e3d-b6a2-cff1ff272967"],
Cell[23468, 618, 1006, 23, 32, "Output",ExpressionUUID->"3c07e1ff-5d2c-424a-90b8-062f6f3b806f"],
Cell[24477, 643, 803, 17, 50, "Output",ExpressionUUID->"f4203f07-fb35-44ea-b01b-268a945032de"],
Cell[25283, 662, 2202, 43, 315, "Output",ExpressionUUID->"0691aafb-e958-4f9b-a2ed-ba40d2e0989f"]
}, Open  ]],
Cell[CellGroupData[{
Cell[27522, 710, 1954, 46, 126, "Input",ExpressionUUID->"561c02b4-cff2-481a-815d-fa6b65619bb0"],
Cell[29479, 758, 2236, 66, 86, "Output",ExpressionUUID->"c8bf85ff-8cc1-45fb-a50b-919679c2007d"],
Cell[31718, 826, 510, 11, 50, "Output",ExpressionUUID->"0c6b7fb1-d64e-44cd-a41c-8f3c7d73ff4a"]
}, Open  ]],
Cell[CellGroupData[{
Cell[32265, 842, 688, 19, 48, "Input",ExpressionUUID->"125bac28-f722-461e-8abd-59078715c59b"],
Cell[32956, 863, 2161, 41, 315, "Output",ExpressionUUID->"07169751-4c2d-4a97-b5b5-7b74af4c7574"]
}, Open  ]],
Cell[CellGroupData[{
Cell[35154, 909, 1085, 26, 107, "Input",ExpressionUUID->"957cff9a-208c-47e7-935f-a1fbdf994974"],
Cell[36242, 937, 795, 14, 50, "Output",ExpressionUUID->"7946d73f-5c59-4dcd-bcfa-7d699d60a764"],
Cell[37040, 953, 684, 10, 32, "Output",ExpressionUUID->"c435b3cd-da9a-4718-8b1f-c1d719d39c0a"],
Cell[37727, 965, 891, 16, 50, "Output",ExpressionUUID->"f563fccc-d2a0-41af-bd0d-feeee9be0554"],
Cell[38621, 983, 2193, 59, 123, "Output",ExpressionUUID->"967fccb2-8b5d-4534-8a46-e69831f5819f"]
}, Open  ]],
Cell[CellGroupData[{
Cell[40851, 1047, 1439, 42, 87, "Input",ExpressionUUID->"57d03ba2-85d3-4de1-9723-82285265f091"],
Cell[42293, 1091, 1124, 25, 48, "Output",ExpressionUUID->"091ae2e9-673d-4faa-8f05-ccb8348935c5"],
Cell[43420, 1118, 2686, 52, 297, "Output",ExpressionUUID->"687ab5c4-67e7-4f23-b754-a500ba1a0911"]
}, Open  ]],
Cell[46121, 1173, 175, 2, 28, "Input",ExpressionUUID->"2eb657e1-d8c2-4135-bb1a-05c54bf452ca"],
Cell[CellGroupData[{
Cell[46321, 1179, 1627, 44, 145, "Input",ExpressionUUID->"2452af80-4c35-47f3-bafb-c9cd0d5ca008"],
Cell[47951, 1225, 1559, 43, 50, "Output",ExpressionUUID->"0399963d-10dd-4cd1-87c1-6cb69640924c"]
}, Open  ]],
Cell[CellGroupData[{
Cell[49547, 1273, 1870, 51, 87, "Input",ExpressionUUID->"fb2a9037-0707-49e7-a8f2-70972d29c120"],
Cell[51420, 1326, 2045, 57, 56, "Output",ExpressionUUID->"6b2d65b3-a229-4eb9-8066-fdf6cac93392"],
Cell[53468, 1385, 1486, 40, 54, "Output",ExpressionUUID->"ee81ef62-d0a2-4889-a23f-8f9aa4d5be1c"]
}, Open  ]],
Cell[CellGroupData[{
Cell[54991, 1430, 1722, 45, 87, "Input",ExpressionUUID->"b3ded18c-d905-4936-878c-877ce976b29d"],
Cell[56716, 1477, 1407, 38, 57, "Output",ExpressionUUID->"27478b02-fb00-4d0e-94f8-0f472db6431d"]
}, Open  ]],
Cell[CellGroupData[{
Cell[58160, 1520, 1360, 38, 87, "Input",ExpressionUUID->"bd46d9c9-69b9-4a82-b9fb-9ecec9eb16dc"],
Cell[59523, 1560, 877, 24, 50, "Output",ExpressionUUID->"73069aa3-027b-4b7b-a5d1-607428c95fbb"]
}, Open  ]],
Cell[CellGroupData[{
Cell[60437, 1589, 1619, 39, 68, "Input",ExpressionUUID->"6b4460a3-c5ad-44d7-99d6-8e9274713271"],
Cell[62059, 1630, 1658, 42, 56, "Output",ExpressionUUID->"f09840fd-dbca-4eb3-885f-92ddedfd7ff7"],
Cell[63720, 1674, 1680, 45, 52, "Output",ExpressionUUID->"5a4f7574-de1e-4b08-aebf-08a97cf49290"]
}, Open  ]],
Cell[CellGroupData[{
Cell[65437, 1724, 1810, 50, 145, "Input",ExpressionUUID->"6b676c48-2317-4993-a469-bc5166cf5cb4"],
Cell[67250, 1776, 2535, 71, 91, "Output",ExpressionUUID->"4530c0fd-e875-4371-adcd-d983e8165907"],
Cell[69788, 1849, 1121, 27, 50, "Output",ExpressionUUID->"a0c7133d-a719-45e4-bfdc-6525906217e1"],
Cell[70912, 1878, 644, 10, 32, "Output",ExpressionUUID->"142e58a8-ed1c-4cbd-aa08-ed5d63fd890f"]
}, Open  ]],
Cell[CellGroupData[{
Cell[71593, 1893, 1423, 40, 87, "Input",ExpressionUUID->"556db6a0-448c-4b10-8d04-e5bb8a40e9ff"],
Cell[73019, 1935, 2581, 71, 91, "Output",ExpressionUUID->"478f9780-7e77-44c8-b7f3-d8fd93453337"],
Cell[75603, 2008, 1614, 42, 52, "Output",ExpressionUUID->"9c8b0b67-85bc-4d95-825f-eb540721bcd3"]
}, Open  ]],
Cell[CellGroupData[{
Cell[77254, 2055, 480, 12, 48, "Input",ExpressionUUID->"0b34ee22-dc78-417d-9e63-faa883413020"],
Cell[77737, 2069, 725, 20, 50, "Output",ExpressionUUID->"6f095d16-e521-4f33-ac19-61d752ac17ef"]
}, Open  ]],
Cell[CellGroupData[{
Cell[78499, 2094, 1574, 38, 68, "Input",ExpressionUUID->"c4f44924-73a0-4cdc-868c-73a89f7d6f52"],
Cell[80076, 2134, 1393, 39, 52, "Output",ExpressionUUID->"d5fd97fe-3524-467c-9331-fe4b1f07959a"],
Cell[81472, 2175, 619, 12, 50, "Output",ExpressionUUID->"7cdacdd1-c9e9-4f23-b8a7-31d80b7aec37"]
}, Open  ]],
Cell[CellGroupData[{
Cell[82128, 2192, 1260, 32, 107, "Input",ExpressionUUID->"6179b91c-cef3-40bd-ae90-e8e6bdaba7e9"],
Cell[83391, 2226, 824, 21, 48, "Output",ExpressionUUID->"c1fc84a1-bb74-42b0-aab6-03a5eb082807"]
}, Open  ]],
Cell[CellGroupData[{
Cell[84252, 2252, 1344, 39, 107, "Input",ExpressionUUID->"235042be-ce0d-46b5-ae3c-952cb485de47"],
Cell[85599, 2293, 1080, 28, 52, "Output",ExpressionUUID->"09da455d-6310-421f-be7c-0e522227053b"]
}, Open  ]],
Cell[CellGroupData[{
Cell[86716, 2326, 1139, 28, 107, "Input",ExpressionUUID->"0d2ecbb7-bd50-4a3b-bfed-2d56009a0e55"],
Cell[87858, 2356, 1283, 37, 52, "Output",ExpressionUUID->"5c69249b-bb52-49fd-ae84-1ddb8682e8d1"],
Cell[89144, 2395, 1131, 33, 52, "Output",ExpressionUUID->"30d71dc7-befb-4575-b61f-1e6add6de3fe"],
Cell[90278, 2430, 952, 26, 52, "Output",ExpressionUUID->"6e1d56e8-91f5-4ee9-a8fc-8f44b7a068c3"]
}, Open  ]],
Cell[CellGroupData[{
Cell[91267, 2461, 516, 12, 48, "Input",ExpressionUUID->"866ee4ba-3862-464c-8434-f4415e97cb06"],
Cell[91786, 2475, 400, 6, 54, "Output",ExpressionUUID->"eef180ee-b007-44c0-9d7d-1385b91e2fa3"]
}, Open  ]],
Cell[CellGroupData[{
Cell[92223, 2486, 2252, 57, 165, "Input",ExpressionUUID->"8f5736cc-45bd-4d29-8b08-a945e7d88ed5"],
Cell[94478, 2545, 586, 14, 50, "Output",ExpressionUUID->"bb1d83ea-14e3-4207-8e84-93d3cb7825f8"],
Cell[95067, 2561, 646, 17, 50, "Output",ExpressionUUID->"3a698300-36d7-4e39-816d-e3806f489449"],
Cell[95716, 2580, 386, 6, 32, "Output",ExpressionUUID->"ef413989-a468-44c7-9a7a-77ae9d4b34b7"]
}, Open  ]],
Cell[CellGroupData[{
Cell[96139, 2591, 1618, 44, 145, "Input",ExpressionUUID->"78c987ca-34a9-470c-bfb0-3ba085f7d9b8"],
Cell[97760, 2637, 616, 15, 48, "Output",ExpressionUUID->"d7b607e1-a63d-4010-bc05-641753137c26"]
}, Open  ]],
Cell[CellGroupData[{
Cell[98413, 2657, 822, 20, 68, "Input",ExpressionUUID->"76a4bf5b-0f82-43e9-8133-18f08a845783"],
Cell[99238, 2679, 726, 13, 50, "Output",ExpressionUUID->"f15a205d-958c-44f8-9574-922eaad5c35f"],
Cell[99967, 2694, 814, 18, 50, "Output",ExpressionUUID->"26a0299b-a5a3-418f-bbcb-1d44135744e8"]
}, Open  ]],
Cell[CellGroupData[{
Cell[100818, 2717, 740, 17, 68, "Input",ExpressionUUID->"43218448-8c29-4af5-9904-3261c50158aa"],
Cell[101561, 2736, 896, 19, 50, "Output",ExpressionUUID->"9bf1333a-95f8-43d2-a67d-2c00f0d677b9"],
Cell[102460, 2757, 804, 16, 50, "Output",ExpressionUUID->"a29628bf-9b2f-4a39-bcb3-f793f5f1deec"]
}, Open  ]],
Cell[CellGroupData[{
Cell[103301, 2778, 1005, 26, 68, "Input",ExpressionUUID->"fb6d73fd-44bd-4067-b43a-c5b882952456"],
Cell[104309, 2806, 2189, 42, 295, "Output",ExpressionUUID->"7b49e12d-268d-4f45-bb80-939bdac1dc59"]
}, Open  ]],
Cell[CellGroupData[{
Cell[106535, 2853, 1803, 45, 203, "Input",ExpressionUUID->"776d620b-edb2-49cc-8e8f-528d6f15a58b"],
Cell[108341, 2900, 444, 11, 48, "Output",ExpressionUUID->"3b02f679-c1d3-481f-85c0-1b1ca81f25c2"],
Cell[108788, 2913, 303, 5, 32, "Output",ExpressionUUID->"a76427ce-e49e-42a2-8187-db44c44fde74"],
Cell[109094, 2920, 301, 5, 32, "Output",ExpressionUUID->"6f3c719a-e0d7-4bf6-b439-4e1440f38c5a"]
}, Open  ]],
Cell[CellGroupData[{
Cell[109432, 2930, 1798, 46, 87, "Input",ExpressionUUID->"0066fba3-85ae-4002-a646-144ce9d48e4d"],
Cell[111233, 2978, 692, 14, 52, "Output",ExpressionUUID->"2aa23908-7dde-4c8f-a3fc-a899ead63fb2"]
}, Open  ]],
Cell[CellGroupData[{
Cell[111962, 2997, 2203, 63, 107, "Input",ExpressionUUID->"7c913ed4-8dc5-4d15-a8aa-aa953de715dc"],
Cell[114168, 3062, 1543, 44, 54, "Output",ExpressionUUID->"07d92677-56b4-4730-91fd-a2de52beb57f"]
}, Open  ]],
Cell[CellGroupData[{
Cell[115748, 3111, 2452, 68, 126, "Input",ExpressionUUID->"49d7be8f-1f1a-4868-ae5f-670d743914b6"],
Cell[118203, 3181, 2279, 68, 81, "Output",ExpressionUUID->"9ac86eca-f06f-4120-92d0-3d7037d84da1"]
}, Open  ]],
Cell[CellGroupData[{
Cell[120519, 3254, 2258, 64, 126, "Input",ExpressionUUID->"1c71f49e-eed1-4388-bb0a-9668a969603e"],
Cell[122780, 3320, 2795, 86, 75, "Output",ExpressionUUID->"891e102a-fd6c-4838-a4b8-43097c511092"]
}, Open  ]],
Cell[CellGroupData[{
Cell[125612, 3411, 1506, 46, 87, "Input",ExpressionUUID->"c38309d0-4380-45da-b50f-0f69b11e9e8d"],
Cell[127121, 3459, 3721, 70, 299, "Output",ExpressionUUID->"c464bd9b-d746-4b38-aef2-b55c4913af0a"]
}, Open  ]],
Cell[130857, 3532, 1419, 36, 68, "Input",ExpressionUUID->"ab35a841-513b-416a-951d-feaf06107d62"],
Cell[CellGroupData[{
Cell[132301, 3572, 1109, 35, 68, "Input",ExpressionUUID->"23405d20-1982-4698-9324-94967bc411b5"],
Cell[133413, 3609, 4646, 85, 342, "Output",ExpressionUUID->"1c3bbf9c-d407-488f-8127-b18b1167f752"]
}, Open  ]],
Cell[138074, 3697, 412, 9, 28, "Input",ExpressionUUID->"e2364a72-af9a-46cb-8bda-a7be1cdfd970"],
Cell[CellGroupData[{
Cell[138511, 3710, 1474, 35, 67, "Input",ExpressionUUID->"97ed8242-c0ea-4334-96bd-bbff356c51b5"],
Cell[139988, 3747, 2809, 51, 315, "Output",ExpressionUUID->"38216fb0-39d8-43ca-96dc-8fb354db4199"]
}, Open  ]],
Cell[CellGroupData[{
Cell[142834, 3803, 888, 23, 68, "Input",ExpressionUUID->"b7d6448c-bd23-4da7-9153-8f5d2799a196"],
Cell[143725, 3828, 790, 19, 49, "Output",ExpressionUUID->"ef5011f4-ecf2-4f69-b88f-d7f5830fbc6e"],
Cell[144518, 3849, 575, 11, 32, "Output",ExpressionUUID->"ba9e5c68-c405-4ba8-b5d4-61b8704503d0"],
Cell[145096, 3862, 962, 23, 48, "Output",ExpressionUUID->"e345d27f-abf4-42ee-b652-9e811e869b04"]
}, Open  ]],
Cell[CellGroupData[{
Cell[146095, 3890, 503, 12, 28, "Input",ExpressionUUID->"7fdba594-8b63-4330-9d19-dc13e8a4ec38"],
Cell[146601, 3904, 283, 5, 32, "Output",ExpressionUUID->"32609fba-cc6e-406e-a958-63c23102460b"]
}, Open  ]],
Cell[146899, 3912, 2164, 54, 138, "Input",ExpressionUUID->"adef222f-8e4e-4894-81f4-ea7eaa0a35a8"],
Cell[CellGroupData[{
Cell[149088, 3970, 2327, 64, 223, "Input",ExpressionUUID->"3ae2c91d-9560-44fb-852b-df99de3a76eb"],
Cell[151418, 4036, 709, 11, 32, "Output",ExpressionUUID->"eb6f1061-bc71-41b7-ab53-7720b78bf702"],
Cell[152130, 4049, 917, 19, 48, "Output",ExpressionUUID->"dc5a5818-5418-4f0c-882b-4c570b05b656"]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[153096, 4074, 219, 4, 53, "Section",ExpressionUUID->"827b1f76-1abd-4cdd-969d-900bdf42df1b"],
Cell[153318, 4080, 736, 13, 48, "Input",ExpressionUUID->"4ef599c2-5003-4059-95db-95dacedade0f"],
Cell[154057, 4095, 881, 18, 87, "Input",ExpressionUUID->"97990813-c426-4785-81cb-342c2b69a24f"],
Cell[154941, 4115, 240, 5, 28, "Input",ExpressionUUID->"83f73557-0e57-40c2-af50-1f4d60de3892"],
Cell[CellGroupData[{
Cell[155206, 4124, 1690, 50, 107, "Input",ExpressionUUID->"d7161c45-5767-4804-98b4-381a1b004555"],
Cell[156899, 4176, 578, 10, 32, "Output",ExpressionUUID->"c4dac62d-af64-4c83-bf4f-79c9bc4c5d05"],
Cell[157480, 4188, 625, 12, 49, "Output",ExpressionUUID->"e1339409-abc7-4254-9703-04e778c5fda0"]
}, Open  ]],
Cell[CellGroupData[{
Cell[158142, 4205, 939, 26, 87, "Input",ExpressionUUID->"1c9c58b4-137d-49ec-a236-a399609d6afc"],
Cell[159084, 4233, 695, 16, 48, "Output",ExpressionUUID->"4bee638b-8437-4f89-8f2d-b1a361a8e4e2"]
}, Open  ]],
Cell[CellGroupData[{
Cell[159816, 4254, 1345, 35, 107, "Input",ExpressionUUID->"70a8e45f-ca84-4700-8f6e-1a69961bbead"],
Cell[161164, 4291, 1163, 30, 48, "Output",ExpressionUUID->"5052d24d-e308-45df-8e23-bec967935dd0"],
Cell[162330, 4323, 993, 25, 48, "Output",ExpressionUUID->"7bd158ff-a5bb-4fe4-b225-3a0b42432c57"]
}, Open  ]],
Cell[CellGroupData[{
Cell[163360, 4353, 970, 27, 68, "Input",ExpressionUUID->"5660586e-ba82-439d-ab59-7d427de0c3b3"],
Cell[164333, 4382, 743, 16, 72, "Output",ExpressionUUID->"88c79584-b540-480f-818c-e5569e0e29e1"]
}, Open  ]],
Cell[CellGroupData[{
Cell[165113, 4403, 1849, 52, 107, "Input",ExpressionUUID->"b56e38b0-c786-4a44-81a0-60051a7ef294"],
Cell[166965, 4457, 274, 6, 32, "Output",ExpressionUUID->"bbcd31ea-b5ab-4aa6-a501-b1110a97ca21"],
Cell[167242, 4465, 311, 8, 49, "Output",ExpressionUUID->"68bb0eb3-fa0e-45b8-a31d-8b8b966ab858"]
}, Open  ]],
Cell[CellGroupData[{
Cell[167590, 4478, 2746, 77, 242, "Input",ExpressionUUID->"640bcca1-c499-4c81-9893-bca850cc548e"],
Cell[170339, 4557, 840, 22, 49, "Output",ExpressionUUID->"41608e1c-5b7e-44c0-ae5e-559b55f19a7e"],
Cell[171182, 4581, 722, 17, 48, "Output",ExpressionUUID->"fe7258cf-0d05-466d-ba12-4fd3409b205a"],
Cell[171907, 4600, 978, 24, 48, "Output",ExpressionUUID->"108674e6-d6e4-4c59-b9b1-af9b8a41abb7"],
Cell[172888, 4626, 590, 12, 48, "Output",ExpressionUUID->"cdc7adb3-4e5c-469e-9ee1-3bfb91cfcb74"],
Cell[173481, 4640, 846, 22, 48, "Output",ExpressionUUID->"100f5ddd-d09b-4fe5-a1fe-75cc18c5276c"],
Cell[174330, 4664, 584, 11, 32, "Output",ExpressionUUID->"8c6193eb-8c4b-45ff-a3da-224cea913953"],
Cell[174917, 4677, 527, 10, 50, "Output",ExpressionUUID->"cfac4a04-91b6-4914-8a29-290eb8ba0a03"]
}, Open  ]],
Cell[CellGroupData[{
Cell[175481, 4692, 1317, 35, 87, "Input",ExpressionUUID->"df90fc19-6bd3-4468-809a-7398b202ecae"],
Cell[176801, 4729, 1015, 26, 48, "Output",ExpressionUUID->"48b95674-9ea6-4751-ad77-8cad5f7a1837"],
Cell[177819, 4757, 826, 21, 48, "Output",ExpressionUUID->"a67e8949-9495-4394-b08f-9cb349115835"]
}, Open  ]],
Cell[CellGroupData[{
Cell[178682, 4783, 1437, 36, 87, "Input",ExpressionUUID->"64a40027-1f07-41e9-8248-c731f24c7928"],
Cell[180122, 4821, 581, 10, 32, "Output",ExpressionUUID->"567be816-e1ac-43c9-b639-d478d19c5b4d"],
Cell[180706, 4833, 561, 9, 46, "Output",ExpressionUUID->"90954e17-b809-4fa0-b9c6-c0d172b11126"]
}, Open  ]],
Cell[181282, 4845, 238, 5, 28, "Input",ExpressionUUID->"91d04813-b135-4eb6-9e4f-7121f7aa4a66"],
Cell[CellGroupData[{
Cell[181545, 4854, 1672, 46, 87, "Input",ExpressionUUID->"f2151af7-bafd-4506-be1f-1db0dc8f3e7a"],
Cell[183220, 4902, 719, 15, 48, "Output",ExpressionUUID->"c9a13fe2-a12e-4088-b4d2-c61e0025c91f"]
}, Open  ]],
Cell[CellGroupData[{
Cell[183976, 4922, 2179, 62, 165, "Input",ExpressionUUID->"24e7749c-b803-4d44-aa6d-63f4a21a96fe"],
Cell[186158, 4986, 2507, 50, 297, "Output",ExpressionUUID->"bc16a0c9-97cd-418a-9fbd-3bababbe7a99"]
}, Open  ]],
Cell[CellGroupData[{
Cell[188702, 5041, 2413, 74, 145, "Input",ExpressionUUID->"96af27bc-5191-4f71-88fc-9cec31cc8955"],
Cell[191118, 5117, 2742, 54, 297, "Output",ExpressionUUID->"08d3b348-d647-41d6-9e54-9c51720116f6"]
}, Open  ]],
Cell[CellGroupData[{
Cell[193897, 5176, 2100, 60, 126, "Input",ExpressionUUID->"41b75b1f-4b58-4de8-ae6d-813d7aeb47d2"],
Cell[196000, 5238, 663, 13, 51, "Output",ExpressionUUID->"df46f188-08a5-45fb-ab4c-5bff1ec61104"]
}, Open  ]],
Cell[CellGroupData[{
Cell[196700, 5256, 2219, 63, 126, "Input",ExpressionUUID->"469f89bc-632c-4499-a224-f3d537ed45bb"],
Cell[198922, 5321, 712, 19, 51, "Output",ExpressionUUID->"9c5b8c94-a437-4732-8fbd-bdb282594bda"]
}, Open  ]],
Cell[CellGroupData[{
Cell[199671, 5345, 1427, 43, 87, "Input",ExpressionUUID->"04598ccb-883f-4458-8b63-30a0ada509ec"],
Cell[201101, 5390, 2586, 52, 295, "Output",ExpressionUUID->"00189a6b-b112-4b40-af31-b459b95833bf"]
}, Open  ]],
Cell[203702, 5445, 602, 16, 82, "Input",ExpressionUUID->"8fbbe756-1122-4b9d-a705-fcc3e040242f"],
Cell[204307, 5463, 536, 15, 28, "Input",ExpressionUUID->"c5217b0d-f95d-4b59-9512-39e95c17038b"]
}, Closed]],
Cell[CellGroupData[{
Cell[204880, 5483, 294, 4, 53, "Section",ExpressionUUID->"c5e20ee4-bdcf-49b3-9e3b-209e9b51330c"],
Cell[205177, 5489, 676, 14, 48, "Input",ExpressionUUID->"c2b7b983-4523-4458-b532-4c7905e155a5"],
Cell[CellGroupData[{
Cell[205878, 5507, 2271, 64, 145, "Input",ExpressionUUID->"ab2b512a-22b5-41b0-ae7e-79a764e9b91b"],
Cell[208152, 5573, 1049, 25, 51, "Output",ExpressionUUID->"01b38a3f-512e-491b-aa32-4e2cc08c3786"]
}, Open  ]],
Cell[CellGroupData[{
Cell[209238, 5603, 255, 5, 28, "Input",ExpressionUUID->"1ca3d014-7c95-42df-b857-ac163e520078"],
Cell[209496, 5610, 1201, 40, 53, "Output",ExpressionUUID->"f852895a-3061-4a93-a2c8-b2e0d9b49da0"]
}, Open  ]],
Cell[CellGroupData[{
Cell[210734, 5655, 1225, 31, 107, "Input",ExpressionUUID->"bc305541-74a6-403c-9df4-748fb329545d"],
Cell[211962, 5688, 1159, 31, 51, "Output",ExpressionUUID->"5f3af360-9e79-44ba-9745-c574e4a3e0fa"]
}, Open  ]],
Cell[CellGroupData[{
Cell[213158, 5724, 1860, 51, 107, "Input",ExpressionUUID->"85f2df62-6159-4b8f-95eb-5de4f2a55086"],
Cell[215021, 5777, 1060, 31, 57, "Output",ExpressionUUID->"c3c455d8-2d83-421d-b8a1-9fe3185d2644"]
}, Open  ]],
Cell[CellGroupData[{
Cell[216118, 5813, 939, 29, 53, "Input",ExpressionUUID->"5b294956-5e8f-4755-8680-ed0fdb8913ba"],
Cell[217060, 5844, 313, 6, 45, "Output",ExpressionUUID->"3f0b66ea-35c8-4624-9e6f-59c68195c0fe"]
}, Open  ]],
Cell[217388, 5853, 354, 8, 28, "Input",ExpressionUUID->"3e3a1d25-c977-46dc-8f79-c62633828872"],
Cell[CellGroupData[{
Cell[217767, 5865, 3545, 82, 184, "Input",ExpressionUUID->"0104daa5-eb55-4aec-934f-a0e93f0f59a5"],
Cell[221315, 5949, 727, 18, 48, "Output",ExpressionUUID->"37b38bf1-ce12-467a-b73d-d1d581eec4dc"],
Cell[222045, 5969, 840, 21, 51, "Output",ExpressionUUID->"84be0f34-5eae-42d4-b089-b6d0c3cb4bb4"]
}, Open  ]],
Cell[CellGroupData[{
Cell[222922, 5995, 594, 19, 47, "Input",ExpressionUUID->"9526a133-9799-4ab3-b8d9-722c68c227d0"],
Cell[223519, 6016, 262, 5, 45, "Output",ExpressionUUID->"b962a246-53ee-4abd-a36f-3402b7527ebf"]
}, Open  ]],
Cell[CellGroupData[{
Cell[223818, 6026, 2169, 50, 165, "Input",ExpressionUUID->"9141cd1f-d5e6-4a40-88d2-9c821973c4fa"],
Cell[225990, 6078, 1387, 43, 55, "Output",ExpressionUUID->"c9e581b6-c77e-40e2-8cf8-b90ca7e11e34"],
Cell[227380, 6123, 1790, 57, 57, "Output",ExpressionUUID->"eca60f05-cea4-45ed-bd0b-9f2528da3707"]
}, Open  ]],
Cell[CellGroupData[{
Cell[229207, 6185, 1910, 52, 126, "Input",ExpressionUUID->"89bf458f-eeba-46ee-adb7-b7e58811ffdd"],
Cell[231120, 6239, 4938, 154, 168, "Output",ExpressionUUID->"c3535642-18bc-4501-baff-0d310247b27c"]
}, Open  ]],
Cell[CellGroupData[{
Cell[236095, 6398, 2347, 57, 203, "Input",ExpressionUUID->"50e5d920-d11c-43ee-9374-503c2bc8bf1d"],
Cell[238445, 6457, 924, 17, 32, "Output",ExpressionUUID->"79737688-f412-45b6-b3d5-84062dab4c23"],
Cell[239372, 6476, 5949, 118, 241, "Output",ExpressionUUID->"58f282cb-5da6-4403-86e0-e25cbc44d809"]
}, Open  ]],
Cell[CellGroupData[{
Cell[245358, 6599, 1201, 31, 107, "Input",ExpressionUUID->"09304e1c-4e07-45ac-94bf-2e4c29771280"],
Cell[246562, 6632, 567, 13, 35, "Output",ExpressionUUID->"f0a53d2c-6629-44f9-ac33-e3b0f28e6604"],
Cell[247132, 6647, 5485, 112, 232, "Output",ExpressionUUID->"607f9684-b0db-49c8-9610-695ac60cfd6d"]
}, Open  ]],
Cell[252632, 6762, 1410, 38, 87, "Input",ExpressionUUID->"c59beceb-ea14-4e09-b482-be019080638d"],
Cell[CellGroupData[{
Cell[254067, 6804, 618, 16, 48, "Input",ExpressionUUID->"c59d1043-bb95-4c00-933c-21b8cb991920"],
Cell[254688, 6822, 3932, 83, 235, "Output",ExpressionUUID->"aea2e72e-b394-4043-8268-c9c5da27d4b8"]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[258669, 6911, 275, 4, 53, "Section",ExpressionUUID->"e5f1422f-75d5-46c1-8171-f3de990f31be"],
Cell[CellGroupData[{
Cell[258969, 6919, 8025, 190, 693, "Input",ExpressionUUID->"a7b3921e-1bbd-4e8f-b110-fb5bbf9bc7e6"],
Cell[266997, 7111, 9062, 179, 263, "Output",ExpressionUUID->"1b535283-189a-41d7-b975-354af6365d01"]
}, Open  ]]
}, Open  ]]
}, Open  ]]
}
]
*)

